Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I try to use FAXCOMEXLib library, but I have a problem with first line! :/
I read many examples, and I do this like that:

FaxServer objFaxServer = new FaxServer();

The program throw an exception:
Unable to cast COM object of type 'System.__ComObject' to interface type 'FAXCOMEXLib.FaxServer'.

So I try to do:
IFaxServer objFaxServer = new FaxServer();

The same result.

When I do it like that:
FaxServer objFaxServer = new FaxServerClass();

or
FAXCOMEXLib.FaxServer objFaxServer = new FAXCOMEXLib.FaxServerClass();


a compile error occurs:
Interop type 'FAXCOMEXLib.FaxServerClass' cannot be embedded. Use the applicable interface instead.


what's going on? please help
Posted
Comments
Mehdi Gholam 26-Sep-11 8:55am    
Have you created a TLBImport for the faxserver class yourself?
mnd017 26-Sep-11 9:01am    
I don't think so. I have to admit, I don't know what is that:/ When I use FaxComLib, it work fine without it.
I mean, in case of FaxComLib I use FaxServer objFaxServer = new FaxServer(); - and it works.
Mehdi Gholam 26-Sep-11 9:08am    
FaxComLib is an ActiveX and it can't be used directly in .net you have to create a proxy with TLBImport, and use that in .net
mnd017 26-Sep-11 9:55am    
well, here is what i did:
1) I copied tlbimp.exe from SDKs dir to my dir (where is FXSCOMEX.dll).
2) tlbimp FXSCOMEX.dll /out:NETFXSCOMEX.dll
3) Add NETFXSCOMEX.dll to my project
And it's wrong again.. How to create that .net lib by TLBImport ?
Mehdi Gholam 26-Sep-11 10:04am    
have you tried "regsvr32 /i fxscomex.dll" on your system?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900