External DLL

I have dabbled in most languages in the past but not a lot of C++ then in writing an adobe plugin I discover I need to write some C++.

Forunatly the code I need to run is in a public method in another DLL

However I am not sure how to access it in GetProcAddress.

The method in question is in a DLL called Lawman.DLL, inside a module called modTest and is called SendAEmail with a string as a parameter. It loads the DLL fine but can't seem to see the method. Help!


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
HINSTANCE dll_instance = LoadLibrary("Lawmansolution.dll");
	if (dll_instance != NULL)
	{
		SendMail sendmail;

		try
		{
			sendmail = (SendMail)GetProcAddress(dll_instance, "SendAsEmail");
		}
		catch (...)
		{
			MessageBox(HWND_DESKTOP, "That's not good, I'm not happy.", "Send", MB_OK);

		}
		
		if (sendmail != NULL)

		{
			MessageBox(HWND_DESKTOP, "Found SendAsEmail", "Send", MB_OK);
			sendmail(sfullpath);
		}
		else
		{
			MessageBox(HWND_DESKTOP, "Can't find SendAsEmail", "Send", MB_OK);
		}

	}
	else
	{
		MessageBox(HWND_DESKTOP, "Can't find DLL", "Send", MB_OK);
	}
Last edited on
It could be a problem of name mangling. Have a look inside the dll what name the function has.
You can use the depency walker for it.
http://www.dependencywalker.com/
Topic archived. No new replies allowed.