Hello...
I am having a problem while attempting to interface to the 1SCDLL API from Delphi. Specifically, I am attempting to write a very simple test app for verifying the DLL function call interfaces, and ultimately, that I can successfully launch the server from a Delphi app.
My simple test app appears to load the library and register the function addresses fine. However, when I call the Start_server function, a view window pops up, but nothing ever appears in the window. The view window appears to be dead. The Viewer shows the following status entries:
Start Encryption, waiting server
Encryption Setup Complete.
If I call Stop_server, the view window goes away as I imagine that it should. Then, the Viewer shows the following entry:
An existing connection was forci
** [that is all that is viewable in the status window. I assume it probably says something like, "forcibly closed" or something to that nature, but I don't know since I can see the whole message ... ]
I am not sure what the problem is here. It seems to be trying to work, but doesn't get past some part of the initial handshaking?
I noticed a few differing definitions for the Start_server call in the forums. My code is using this definition for the Start_server call:
TSCDLL_StartServer = procedure(
aID : PChar;
aRepeater : PChar;
aHostName : PChar;
aPort : integer;
aPassword : PChar;
aProxy : boolean;
aClassname : PChar;
aShouldWait : boolean); cdecl;
When I call Start_server, I call it with the following values:
MyStartServer(
'test',
'',
PChar(edtHostName.Text),
StrToInt(edtPort.Text),
PChar(edtPassword.Text),
False,
'PcHelpWare Connection',
False);
** [edtXXXX are TEdits that I am using to try values for connecting with. They are initially filled with values that work when running from a custom server.]
Any ideas on what I may be missing here? Do I have the DLL function definitions correct? Also, is there a header file or something of that nature for the 1SCDLL calls (Start_server and Stop_server)? Or maybe more documentation that is available on the forum / website?
Thanks much...
Hoby Smith
Missouri, USA
Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864
Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Bluesky/AT Protocol: https://bsky.app/profile/ultravnc.bsky.social
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864
Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Bluesky/AT Protocol: https://bsky.app/profile/ultravnc.bsky.social
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc
Delphi Call To 1SCDLL API Start_Server Appears to Fail
Re: Delphi Call To 1SCDLL API Start_Server Appears to Fail
Can you post the C/C++ prototypes of the function. Also note that "nil" and an empty string is not the same!!!
Oliver
How to Report Bugs Effectively
My homepage | WinDirStat
PGP-keys:
How to Report Bugs Effectively
My homepage | WinDirStat
PGP-keys:
- Forum or UltraVNC-related: 0xA2DD1DBD, E18B 2E2F 4F3E D143 4ED4 3E2B E172 FB55 A2DD 1DBD
- Other matters: 0x0E88590F, 38B5 5EBA A470 C0F7 0942 81B8 C779 D829 0E88 590F
Re: Delphi Call To 1SCDLL API Start_Server Appears to Fail
Well, here are the C/C++ prototypes that I am "porting" from. They are taken from your site as follows:
MY1SCDLL_API void Start_server(char *ID, char *repeater,char *direct,int port,char *passwd,bool proxy,char *classname,bool have_to_wait);
MY1SCDLL_API void Stop_server();
However, as I am coding in Delphi, I don't have a C/C++ prototype, but am simply coding from the prototypes given above. Additionally, as I have no header files available for reference, I have no idea what a MY1SCDLL_API modifier actually is. I assume that a standard c stack frame is employed (cdecl), but I have no way to know.
Regarding NIL vs. "Empty String"... If I change the empty strings to nil that I am passing, namely the Repeater host, then I get an access violation from the 1SCDLL.
Perhaps, what would be of value, is some sort of reference as to what the parameters should be. I get the general concept of the parameters (with the exception of the ID, what is that?). However, maybe something that described the parameters in this form, "if you use nil for this, then this will happen, otherwise it should be [description]". That would be quite helpful.
Thanks again...
MY1SCDLL_API void Start_server(char *ID, char *repeater,char *direct,int port,char *passwd,bool proxy,char *classname,bool have_to_wait);
MY1SCDLL_API void Stop_server();
However, as I am coding in Delphi, I don't have a C/C++ prototype, but am simply coding from the prototypes given above. Additionally, as I have no header files available for reference, I have no idea what a MY1SCDLL_API modifier actually is. I assume that a standard c stack frame is employed (cdecl), but I have no way to know.
Regarding NIL vs. "Empty String"... If I change the empty strings to nil that I am passing, namely the Repeater host, then I get an access violation from the 1SCDLL.
Perhaps, what would be of value, is some sort of reference as to what the parameters should be. I get the general concept of the parameters (with the exception of the ID, what is that?). However, maybe something that described the parameters in this form, "if you use nil for this, then this will happen, otherwise it should be [description]". That would be quite helpful.
Thanks again...
Re: Delphi Call To 1SCDLL API Start_Server Appears to Fail
I think I found a solution for this. Try supplying an empty string for the password parameter in your call to Start_server rather than the contents of the edit field.
Lachlan
Lachlan
Last edited by LachlanG on 2007-05-19 02:43, edited 1 time in total.