CALL DLL FUNCTION SYNTAX

Got a problem you cannot solve? Try here.
vincemcc00
Posts: 5
Joined: Fri Jul 13, 2007 9:12 am

CALL DLL FUNCTION SYNTAX

Postby vincemcc00 » Fri Jul 20, 2007 8:53 am

Can anyone see whats wrong with this: I keep getting a function not found error:

~InstallAware Clipboard Data~
~Call DLL Function~
~{C8EA685B-9A90-4245-994D-9F2B0BD0011D}~
~"C:\\Users\\myname\\Documents\\Visual Studio 2005\\Projects\\getIPaddress\\getIPaddress\\bin\\Debug\\getIPaddress.dll",test,bool,testVar,$~
~mIDEFunc.dll\\mEXEFunc.dll~


Any help is appreciated.
here's the dll its just a simple c# class to get the ipAddress of a server.

------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;

namespace getIPaddress
{
public class ipManager
{
public ipManager()
{
}

public string returnHostName()
{
String strHostName;
strHostName= Dns.GetHostName();
return strHostName;
}

public bool test()
{
return true;
}

public string returnIPAddress()
{
String returnIP;
IPHostEntry ipEntry = Dns.GetHostByName(returnHostName());
IPAddress[] addr = ipEntry.AddressList;


returnIP = addr[0].ToString();


return returnIP;
}
}

}
----------------------------------------------------------------------------------

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Jul 20, 2007 9:20 am

I don't think you can create C# DLLs which can be called by ordinary Win32 apps using the STDCALL calling convention.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

vincemcc00
Posts: 5
Joined: Fri Jul 13, 2007 9:12 am

Postby vincemcc00 » Fri Jul 20, 2007 9:31 am

so do i have to write the dll in c++ so??
Also just wondering can I load a dll into a $PROGRAMFOLDER$ on setup of the installer. Can I just use the INSTALL FILES command in setup. So that I can actually use the CALL DLL FUNCTION to populate a varaiable before the dialog appears.

~Install Files~
~{08E472E5-5D3F-40E7-88CD-1B673C02F140}~
~C:\\Users\\myname\\Documents\\Visual Studio 2005\\Projects\\getIPaddress\\getIPaddress\\bin\\Debug\\getIPaddress.dll~
~FALSE|~
~$PROGRAMFILES$~
~FALSE~
~FALSE~
~FALSE~
~FALSE~
~FALSE~
~FALSE~
~FALSE~
~FALSE~
~FALSE~

Regards
Vince

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Jul 20, 2007 9:35 am

Install Files (and other purple - AKA Windows Installer) commands are not processed until Apply Install. So you may want to add the DLL as a support file and reference it using $SUPPORTDIR$ instead.

You can write a Win32 DLL in any language that supports pure Win32 output, but .NET probably won't work.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

vincemcc00
Posts: 5
Joined: Fri Jul 13, 2007 9:12 am

Postby vincemcc00 » Fri Jul 20, 2007 9:44 am

thanks for the reply-im grateful for the nod in the right direction

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Jul 20, 2007 9:46 am

Also, I just heard that with Delphi .NET you can create DLLs in .NET that can still be called from Win32 applications using a process called reverse P/Invoke.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

vincemcc00
Posts: 5
Joined: Fri Jul 13, 2007 9:12 am

Postby vincemcc00 » Fri Jul 20, 2007 10:19 am

thats an idea. Ive used P/Invoke for API fuctions on the windows mobile compact framework which is like a lightweight .net so I could just use it here as well maybe. I dunno anything about Delphi to be honest but i might try P/Invoke in this dll and see what happens


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 102 guests