how to call function in a DLL from ATL COM method 
Author Message
 how to call function in a DLL from ATL COM method

thanks Tian,
but what i want to do is i want to call that function in lib from delphi5.
i dont know how to do it.(do you know a way for it?)
i desided to write a com object with this method.
then i tryed it as you said.
i am getting problem with method perameters.
i will explain the method now

//int Isfoc2Iscii(unsigned char *sIsfoc, unsigned char *sIscii, int
nIsciiLen, char *Script_mn)

This Function will convert an ISFOC string to ISCII String.
sIsfoc is the source null terminated string containing the ISFOC
characters.[IN]
sIscii is the destination buffer which will contain the converted null
terminated ISCII string.[OUT]

nIsciiLen is the size of the sIscii buffer in bytes.[IN]
Script_mn is a 2/3 character script mnemonic string. E.g. "DV" - Devanagari,
"DVB" - Devanagari Bilingual[OUT]

can you tell me what should i enter in perameter field of add method in ALT
object.

thank you very much
Akkineni Rajesh



Quote:
> Hi,

> If you have the import library of ismapi32.dll, you can use Implicit
> linking. Otherwise, you should call LoadLibrary() and GetProcAddress() as
> the following code snippet:

> //begin
> typedef int (*Isfoc2Iscii)(unsigned char *, unsigned char *, int ,char *);
> .....

> HMODULE hDll = LoadLibrary("ismapi32.dll");
> Isfoc2Iscii lpFun= (Isfoc2Iscii) GetProcAddress(hDll, "Isfoc2Iscii");
> //call the function
> lpFun(......);
> .....

> FreeLibrary(hDll);

> //end

> For more information, please refer the article "Link an Executable to a
> DLL" at

http://www.*-*-*.com/

- Show quoted text -

Quote:
> executable_to_a_dll.htm.

> Regards,
> HuangTM



Mon, 10 Nov 2003 22:28:42 GMT  
 how to call function in a DLL from ATL COM method
Hi Akkineni,

Do you mean that the DLL was built in delphi with LIB file(import library)?
As I am not familiar with delphi, I am not sure whether you can use
implicit linking with the LIB file created by delphi.

Quote:
>>can you tell me what should i enter in perameter field of add method in

ALT object.
You mean the parameters for CFirst_ATL::AddNumbers? It depends where the
data/buffer sIsfoc, sIscii and Script_mn come from in your project.

Regards,
HuangTM



Tue, 11 Nov 2003 16:56:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to call function in a DLL from ATL COM method

2. Cant use VC ATL COM DLL method at VB project

3. hot to call win32 function from atl method

4. calling a method in a J++ COM DLL from C++

5. call a method in J++ COM DLL from C++

6. ATL COM - Passing ATL COM classes through another ATL COM class in the same app

7. COM/ATL novice:passing object pointers through methods on a COM interface

8. Calling ATL COM Dll from Remote Machine

9. Calling an ATL COM Dll from C program

10. ATL COM object hangs on user32.dll MessageBoxA() call

11. ATL COM object hangs on user32.dll MessageBoxA() call

12. Enable COM clients call methods inside COM events

 

 
Powered by phpBB® Forum Software