Article View: borland.public.cppbuilder.nativeapi
Article #15962create a dll for siemens pcs7 wincc and load function
From: Phjilipp
Date: Thu, 05 Jun 2003 12:13
Date: Thu, 05 Jun 2003 12:13
51 lines
1962 bytes
1962 bytes
Hello,
i have to create a dll which functions will be in us ein siemens pcs7 wincc.
To load a function from a dll, my customer use following code:
Here is an exmaple how to use pcs7 code to load a function from a dll:
void LoadDLL()
{
#pragma code ("Kernel32.DLL");
HINSTANCE LoadLibrary(LPCTSTR lpLibFileName);
#pragma code();
HINSTANCE dllhinst = LoadLibrary("check.dll");
}
My function in my dll is declares like:
extern "C" int __declspec(dllexport) __stdcall CheckVersion()
{
// calculations
return value;
}
//--------------------------------------------------------------------------
-
My pcs7 Code for the customer looks like:
void LoadDLL()
{
#pragma code ("check.DLL");
int CheckVersion();
#pragma code();
int val = CheckVersion();
if (val == -1)
{
// nicht registriert
}
else
{
// registriert
}
}
As i am not able to check this i am not shure is this is correkt. What do
you think.Will my customer be able to run this function? What should i
change that he is able.
philipp
Technical Details
Message-ID:
<3edf3401@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,993ccf88c4ededac,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-06-05 05:21:37 PST From: "Phjilipp" <philipp@gmxxx.de> Newsgroups: borland.public.cppbuilder.nativeapi Subject: create a dll for siemens pcs7 wincc and load function Date: Thu, 5 Jun 2003 14:13:48 +0200 Lines: 56 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 134.102.113.13 Message-ID: <3edf3401@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1054815233 134.102.113.13 (5 Jun 2003 05:13:53 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail