CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2001
    Posts
    4

    Get h, idll, c files from ocx

    If I have a OCX, how do I produce the .IDL, .H, .C files? I used OleViewer, it worked for .IDL file but it doesn't work for .H and .C. Is there any other ways?


  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Get h, idll, c files from ocx

    Not sure if you can. I might be wrong since I'm also new in this OCX thingy. But if we look at the logic, it kinda make sense not to be able to get .C and .H (at least .C) out of the .OCX. The idea is to allow a programmer to pass a functional DLL to others without exposing the algorithm/code itself. So if you can convert back from OCX to .C, then it is not cool.

    Just my 2 cents,
    -Cool Bizs

    Good Luck,
    -Cool Bizs

  3. #3
    Join Date
    May 2001
    Posts
    4

    Re: Get h, idll, c files from ocx

    Ok, I want to use the .h, and .c file to be able to use the object in my app. See, I can’t use MFC, or ATL, in my app. So, I have to do declare the whole interface in my code, and then use it.
    I need the .h and .c file to declare the interface. I don’t want to reverse engineer the binary ocx file. The .c file in this case is a _i.c file this file contains the actual definitions of the IIDs and CLSIDs.

    But I think I have found the solution, you can declare the IIDs by just copy and past the IIDs form OleViewer to your project, and use #import directive to generate the .tlh and .tli files. Basically link to the object through type library.



  4. #4
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Get h, idll, c files from ocx

    Yes you're right. You can use the IMPORT directive and VC++ IDE will create the .H and .C which will allow you to use smartpointers and all. I thought that you're talking about getting the .C which is the implementation file for the OCX.

    -Cool Bizs

    Good Luck,
    -Cool Bizs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured