Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Compiling an idl?

Compiling an idl?

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpc++question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Killen
    wrote on last edited by
    #1

    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!!

    A 1 Reply Last reply
    0
    • K Killen

      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!!

      A Offline
      A Offline
      Adam Gritt
      wrote on last edited by
      #2

      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.

      K 1 Reply Last reply
      0
      • A Adam Gritt

        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.

        K Offline
        K Offline
        Killen
        wrote on last edited by
        #3

        Thanks! I also tried not including the c-file in my project which got rid of problem no 1... "Time to give a Newtonian demonstration, of a bullet, its mass and its acceleration." -Stephen Hawking the gangsta rapper

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups