Delphi

Why Delphi says 'cannot resolve unit name xxx'?

两盒软妹~` 提交于 2019-12-30 08:16:13
问题 I'm working with Delphi2010 Enterprise Update 4. When I'm opening my project in the IDE and displaying the mainform code, there are 2 unit names underline in red . xxx http://img268.imageshack.us/img268/6475/unitnameunresolved.png. I have verified that the path to the unit source is in the Library path and in the Browsing path . Surprisingly, when I'm doing a right-clicking on the unit and selecting Open file at cursor , it works (ie. delphi opens the right unit). Any idea about that ? 回答1:

Why does WaitForMultipleObjects fail with multiple thread handles?

梦想与她 提交于 2019-12-30 08:14:29
问题 In the following test program each test thread adds its handle to a global TThreadList when it starts executing, and removes its handle from the same list when its execution is about to end. For testing purposes, additionally, each thread makes sure it adds its handle before the main thread locks the list (to duplicate their handles and start waiting on them to finish). The threads also make sure they don't remove their handles before the main thread locks the list. The test program runs fine

How can I extract a resource into a file at runtime?

徘徊边缘 提交于 2019-12-30 08:04:48
问题 I want to distribute only a single .exe, however, at runtime I would like it to extract some embedded image resources to the users hard disk drive. Can I, and if so, how? 回答1: Use Delphi's TResourceStream. It's constructor will find and load the resource into memory, and it's SaveToFile method will do the disk write. Something similar to this should work: var ResStream: TResourceStream; begin ResStream := TResourceStream.Create(HInstance, 'YOURRESOURCENAME', RT_RCDATA); try ResStream.Position

How to call NSBeep from Delphi

你离开我真会死。 提交于 2019-12-30 08:00:14
问题 I'm looking for a MessageBeep replacement on the OS X. It seems that the proper function to call would be NSBeep but it is not supported by XE2 RTL. How do I call NSBeep from Delphi application? 回答1: It's just a plain C function: procedure NSBeep; cdecl; external '/System/Library/Frameworks/AppKit.framework/AppKit' name '_NSBeep'; 来源: https://stackoverflow.com/questions/10287149/how-to-call-nsbeep-from-delphi

External Exception EEFFACE in Delphi

自作多情 提交于 2019-12-30 07:54:06
问题 While debugging my application with Delphi 2009, I sometimes get the following exception occurring: (source: beholdgenealogy.com) This only happens occasionally, but after pressing OK, then my IDE and program both may freeze. If I am lucky I can sometimes do a File/SaveAll in Delphi, but sometimes I can't. Either way I am stuck and then the only thing I can do is use Windows Task Manager to shut down Delphi. Of course, if I was unable to SaveAll, then I lose all the edits I had made since

How to Listen 1200 devices [closed]

时光总嘲笑我的痴心妄想 提交于 2019-12-30 07:51:28
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am using Delphi I have a device. Device has ethernet card.I give a ip adress and port to device(Server ip adress). Device send data with tcp/ip every second to server. I have to Listen device from Server.I have

How to Listen 1200 devices [closed]

Deadly 提交于 2019-12-30 07:51:19
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am using Delphi I have a device. Device has ethernet card.I give a ip adress and port to device(Server ip adress). Device send data with tcp/ip every second to server. I have to Listen device from Server.I have

How do I get a java JNA call to a DLL to get data returned in parameters?

房东的猫 提交于 2019-12-30 07:49:29
问题 I have this java test package ftct; import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Platform; import com.sun.jna.win32.StdCallLibrary; import java.util.Date; public class LibFTCT { public LibFTCT() { } public interface LibFTCTLib extends StdCallLibrary { LibFTCTLib INSTANCE = (LibFTCTLib) Native.loadLibrary( "FTCTLib", LibFTCTLib.class); int a(int x); int DoCommand(int Command, int Param); int GetDataRecord(int RecordNum, int StreamNum, Date ReadingTime, double AIN1,

Saving a Base64 string to disk as a binary using Delphi 2007

你。 提交于 2019-12-30 07:45:53
问题 I have a Base64 binary string that is part of an XML document that is sent to us by a 3rd party supplier, I would like to be able to save it back to its original file format (jpg). Using the accepted answer from this question "saving a base64 string to disk as a binary using php" I can save the string to a jpg with little effort, so I know the string is in good form and is a JPG file. But how do I do this in Delphi 2007? Looking on the net I found a tutorial on how to convert the Base64 into

Saving a Base64 string to disk as a binary using Delphi 2007

左心房为你撑大大i 提交于 2019-12-30 07:45:19
问题 I have a Base64 binary string that is part of an XML document that is sent to us by a 3rd party supplier, I would like to be able to save it back to its original file format (jpg). Using the accepted answer from this question "saving a base64 string to disk as a binary using php" I can save the string to a jpg with little effort, so I know the string is in good form and is a JPG file. But how do I do this in Delphi 2007? Looking on the net I found a tutorial on how to convert the Base64 into