Compiling an idl?
-
Hello! I'm trying to use an ActiveX dll written in VB from my VC++ program. After reading the article http://www.codeproject.com/com/vb\_from\_vc.asp I still have some problems.:( I thought the compiler would generate error-free files for me to use! In the project settings I have made the compiler create a h-file and a c-file when compiling the idl-file, which works just fine. Those files are included in my project, but then these errors occur when I try to build it. 1. In my generated c-file I get this error: fatal error C1010: unexpected end of file while looking for precompiled header directive 2. I include my generated h-file in my dialog, but I get an error: error C2061: syntax error : identifier '_sockdata' The declaration in the h-file looks like this: virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendToServer( /* [in] */ /* external definition not present */ _sockdata __RPC_FAR *MySesH) = 0; Please, if you have any idea what I could do to solve the problem, give me a reply! Thanks!!
-
Hello! I'm trying to use an ActiveX dll written in VB from my VC++ program. After reading the article http://www.codeproject.com/com/vb\_from\_vc.asp I still have some problems.:( I thought the compiler would generate error-free files for me to use! In the project settings I have made the compiler create a h-file and a c-file when compiling the idl-file, which works just fine. Those files are included in my project, but then these errors occur when I try to build it. 1. In my generated c-file I get this error: fatal error C1010: unexpected end of file while looking for precompiled header directive 2. I include my generated h-file in my dialog, but I get an error: error C2061: syntax error : identifier '_sockdata' The declaration in the h-file looks like this: virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendToServer( /* [in] */ /* external definition not present */ _sockdata __RPC_FAR *MySesH) = 0; Please, if you have any idea what I could do to solve the problem, give me a reply! Thanks!!
First you would have to disable pch(precompiled headers) for the files when you include them in your project. Second, you have to make sure that you include references to anything you add in your VB project. In this case try adding #import "c:\windows\system32\mswnsck.ocx" assuming that is what was included in your vb project for win sock ability. Add it before you include the header file generated from midl. An alternative to using this method is to include two lines in your stdafx.h. #import "mswnsck.ocx" #import "vb.dll" no_namespace named_guids // rename to correct name for your activx dll. This should fix the problem. however, another may pop up depending on if you have anything other than the standard references or controls added to your vb project.
-
First you would have to disable pch(precompiled headers) for the files when you include them in your project. Second, you have to make sure that you include references to anything you add in your VB project. In this case try adding #import "c:\windows\system32\mswnsck.ocx" assuming that is what was included in your vb project for win sock ability. Add it before you include the header file generated from midl. An alternative to using this method is to include two lines in your stdafx.h. #import "mswnsck.ocx" #import "vb.dll" no_namespace named_guids // rename to correct name for your activx dll. This should fix the problem. however, another may pop up depending on if you have anything other than the standard references or controls added to your vb project.