How to read .ocx file in C++ (Not MFC)

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #11
Nov 29th, 2007
the generated header file that you posted contains
#pragma once
#pragma pack(push, 8)

#include <comdef.h>

namespace MMAPLib {
// ...
} // namespace MMAPLib

and your #import is
#import "c:\WINNT\system32\MMap.ocx" \
named_guids LIBID_MMAPLib,DIID_DMMap,DIID_DMMapEvents,CLSID_MMap \
no_namespace MMAPLib
these are not consistent with each other (no_namespace => do not generate a namespace)

you need to recompile your code after making any modification to the #import to get the
newly generated header file. i suspect you have not done that.

if (and only if) your header generates definitions inside namespace MMAPLib {
add a using namespace MMAPLib; directive right after the #import
then either of these should work
  1. CoCreateInstance( CLSID_MMap,
  2. 0,
  3. CLSCTX_ALL,
  4. DIID__DMMap,
  5. reinterpret_cast <void**>(&pMP) );
or
  1. CoCreateInstance( __uuidof( MMap ),
  2. 0,
  3. CLSCTX_ALL,
  4. __uuidof( _DMMap ),
  5. reinterpret_cast <void**>(&pMP) );
Last edited by vijayan121; Nov 29th, 2007 at 9:48 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 22
Reputation: swethakiran is an unknown quantity at this point 
Solved Threads: 0
swethakiran swethakiran is offline Offline
Newbie Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #12
Nov 30th, 2007
How u told in previous mail like that only I did modifications in my code.Again same problem is coming.Now , I am sending the mmap.cpp,mmap.h and also mmap.tlh.

If you dont mind can you tell what changes again need to do.

/************************mmap.tlh file***************************/


  1. #pragma once
  2. #pragma pack(push, 8)
  3.  
  4. #include <comdef.h>
  5.  
  6. namespace MMAPLib {
  7.  
  8. //
  9. // Forward references and typedefs
  10. //
  11.  
  12. struct __declspec(uuid("d5f63c22-b3d3-11d0-b8f0-0020af344e0a"))
  13. /* dispinterface */ _DMMap;
  14. struct __declspec(uuid("d5f63c23-b3d3-11d0-b8f0-0020af344e0a"))
  15. /* dispinterface */ _DMMapEvents;
  16. struct /* coclass */ MMap;
  17. //
  18. // Smart pointer typedef declarations
  19. //
  20.  
  21. _COM_SMARTPTR_TYPEDEF(_DMMap, __uuidof(IDispatch));
  22. _COM_SMARTPTR_TYPEDEF(_DMMapEvents, __uuidof(IDispatch));
  23.  
  24. //
  25. // Type library items
  26. //
  27.  
  28. struct __declspec(uuid("d5f63c22-b3d3-11d0-b8f0-0020af344e0a"))
  29. _DMMap : IDispatch
  30. {
  31. //
  32. // Property data
  33. //
  34.  
  35. __declspec(property(get=GetMapNorth,put=PutMapNorth))
  36. double MapNorth;
  37. __declspec(property(get=GetMapSouth,put=PutMapSouth))
  38. double MapSouth;
  39. ..........................
  40. ....
  41. ..
  42. ..
  43. ..
  44. };
  45.  
  46. struct __declspec(uuid("d5f63c23-b3d3-11d0-b8f0-0020af344e0a"))
  47. _DMMapEvents : IDispatch
  48. {
  49. //
  50. // Wrapper methods for error-handling
  51. //
  52.  
  53. // Methods:
  54. HRESULT MovePosition (
  55. double X,
  56. double Y );
  57. HRESULT Click ( );
  58. HRESULT DblClick ( );
  59. ....
  60. .....
  61. .....
  62. };
  63.  
  64. struct __declspec(uuid("d5f63c24-b3d3-11d0-b8f0-0020af344e0a"))
  65. MMap;
  66. // [ default ] dispinterface _DMMap
  67. // [ default, source ] dispinterface _DMMapEvents
  68.  
  69. //
  70. // Named GUID constants initializations
  71. //
  72.  
  73. extern "C" const GUID __declspec(selectany) LIBID_MMAPLib =
  74. {0xd5f63c21,0xb3d3,0x11d0,{0xb8,0xf0,0x00,0x20,0xaf,0x34,0x4e,0x0a}};
  75. extern "C" const GUID __declspec(selectany) DIID__DMMap =
  76. {0xd5f63c22,0xb3d3,0x11d0,{0xb8,0xf0,0x00,0x20,0xaf,0x34,0x4e,0x0a}};
  77. extern "C" const GUID __declspec(selectany) DIID__DMMapEvents =
  78. {0xd5f63c23,0xb3d3,0x11d0,{0xb8,0xf0,0x00,0x20,0xaf,0x34,0x4e,0x0a}};
  79. extern "C" const GUID __declspec(selectany) CLSID_MMap =
  80. {0xd5f63c24,0xb3d3,0x11d0,{0xb8,0xf0,0x00,0x20,0xaf,0x34,0x4e,0x0a}};
  81.  
  82. //
  83. // Wrapper method implementations
  84. //
  85.  
  86. #include "c:\mmap-nov-16\mmap\debug\MMap.tli"
  87.  
  88. } // namespace MMAPLib
  89.  
  90. #pragma pack(pop)
  91.  
  92. /******************************end the mmap.tlh file***************************/


/*****************************mmap.cpp*************************************/

  1. #import "c:\WINNT\system32\MMap.ocx" \
  2. named_guids LIBID_MMAPLib,CLSID_MMap,DIID__DMMap,DIID__DMMapEvents
  3.  
  4.  
  5. using namespace MMAPLib;
  6.  
  7. #include "stdafx.h"
  8. #include <cassert>
  9. #include<windows.h>
  10. #include "mmap.h"
  11.  
  12.  
  13. void main()
  14. {
  15. CoInitialize( NULL );
  16. _DMMap* pMap = 0;
  17.  
  18. HRESULT hr = CoCreateInstance(CLSID_MMap,
  19. 0,
  20. CLSCTX_ALL,
  21. DIID__DMMap,
  22. reinterpret_cast <void **>(&pMap));
  23.  
  24. assert(SUCCEEDED(hr));
  25. hr = pMap->GetMapID();
  26. assert(SUCCEEDED(hr));
  27. pMap ->Release();
  28. CoUninitialize();
  29.  
  30. }
  31.  
  32. /**********************end the mmap.cpp file**********************************/



/********************************mmap.h***************************/

  1. class _DMMap
  2. {
  3. public:
  4. double GetMapID();
  5. void PutMapID(double);
  6. double Release();
  7. };
  8. //_DMMap DIID__DMMap;
  9.  
  10.  
  11. /**********************end the mmap.h file******************************/


Now also again I am getting error is that 'CLSID_MMap' : undeclared identifier
'DIID__DMMap' : undeclared identifier


I have one doubt that is it necessary to do changes in mmap.h file also?
Please tell me the sollution what I did wrong.Hope you will give the reply.




Thanks & Regards,
swetha
Last edited by Ancient Dragon; Nov 30th, 2007 at 10:06 am. Reason: add code tags
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #13
Nov 30th, 2007
looks like you are compiling with the /Yu"stdafx.h" compiler option. new projects in Visual C++ set this option by default to increase compilation speed. (to change the option, use the Project.Settings.C++.Precompiled Headers dialog.)

the Visual C++ Programmer's Guide explains the behavior you see:
"The compiler treats all code occurring before the .h file as precompiled. It skips to just beyond the #include directive associated with the .h file, uses the code contained in the .pch file, and then compiles all code after filename.."
http://msdn2.microsoft.com/en-us/lib...6c(VS.71).aspx
this means, everything in your code file before the #include "stdafx.h" line is completely ignored, because the compiler assumes that the necessary information is in your precompiled header.

you can fix the problem by one of these ways
a. move the #import directive and the using namespace directive after the other #include statements. in particular #include "stdafx.h"
b. move the #import directive and the using namespace directive into stdafx.h
c. turn off precompiled headers option (set it to not using precompiled headers)

then clean (or delete the .pch file) and rebuild you project.
Last edited by vijayan121; Nov 30th, 2007 at 10:06 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 22
Reputation: swethakiran is an unknown quantity at this point 
Solved Threads: 0
swethakiran swethakiran is offline Offline
Newbie Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #14
Nov 30th, 2007
Hi vijayan,

Thank you very much for ur prompt replies.

I tried all your suggestions. However, I am getting syntax errors in mmap.tlh file while reading it like the following

error C2146: syntax error : missing ';' before identifier 'BackPicture'
error C2501: 'PicturePtr' : missing storage-class or type specifiers
etc...

I am including #import and namespace in image.cpp file. Similarly, do I need to include anything in image.h file? Whether I include definition of _DMMap(dispinterface in mmap.tlh) as class in image.h file or doesn't inculde image.h in cpp file, it didn't make any difference to the result.

MDSN help suggested to the following. However, I am not sure on how to do it and whether to do it or not.

"The path specified by the /I (additional include directories) compiler option, except it the compiler is searching for a type library that was referenced from another type library with the no_registry attribute"
http://msdn2.microsoft.com/en-us/lib...b6(vs.80).aspx

Thanks a lot for ur prompt responses and listening to my queries. I am new to this and there are no expertize in this small company where I am working.

Regards,
Swetha
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #15
Dec 1st, 2007
first do this. create a small project which contains only a main.cpp as follows.
  1. #include <cassert>
  2. #include<windows.h>
  3. #import "c:\WINNT\system32\MMap.ocx" named_guids
  4. using namespace MMAPLib;
  5.  
  6. void main()
  7. {
  8. CoInitialize( 0 );
  9. _DMMap* pMap = 0;
  10.  
  11. HRESULT hr = CoCreateInstance(CLSID_MMap, 0, CLSCTX_ALL,
  12. DIID__DMMap,reinterpret_cast <void**>(&pMap));
  13. assert(SUCCEEDED(hr));
  14. pMap->Release();
  15. CoUninitialize();
  16. }
does this compile and link without errors?
if no, post the complete error message(s) generated by the compiler/linker and the complete .tlh file that was generated.
if yes, run the program. does it run without errors?
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 22
Reputation: swethakiran is an unknown quantity at this point 
Solved Threads: 0
swethakiran swethakiran is offline Offline
Newbie Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #16
Dec 3rd, 2007
Hi vijayan,

How u told like that only i was doing from starting onwards.But the errors are coming.
I think I already sent MMap.tlh file in previous mails.So,now I am sending while compiling which errors I am getting.


/********************ERRORS**************************/

C:\mmap-nov-16\Radar\Radar.cpp(8) : error C2017: illegal escape sequence
c:\mmap-nov-16\radar\debug\mmap.tlh(148) : error C2146: syntax error : missing ';' before identifier 'BackPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(148) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(148) : error C2501: 'BackPicture' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(164) : error C2146: syntax error : missing ';' before identifier 'Font'
c:\mmap-nov-16\radar\debug\mmap.tlh(164) : error C2501: 'FontPtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(164) : error C2501: 'Font' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(178) : error C2146: syntax error : missing ';' before identifier 'MapPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(178) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(178) : error C2501: 'MapPicture' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(260) : error C2146: syntax error : missing ';' before identifier 'ObjectPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(260) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(260) : error C2501: 'ObjectPicture' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(288) : error C2146: syntax error : missing ';' before identifier 'WaypointPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(288) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(288) : error C2501: 'WaypointPicture' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(360) : error C2146: syntax error : missing ';' before identifier 'GetBackPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(360) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(376) : error C2146: syntax error : missing ';' before identifier 'GetFont'
c:\mmap-nov-16\radar\debug\mmap.tlh(376) : error C2501: 'FontPtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(390) : error C2146: syntax error : missing ';' before identifier 'GetMapPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(390) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(472) : error C2146: syntax error : missing ';' before identifier 'GetObjectPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(472) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(500) : error C2146: syntax error : missing ';' before identifier 'GetWaypointPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(500) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tli(180) : error C2143: syntax error : missing ';' before 'tag::id'
c:\mmap-nov-16\radar\debug\mmap.tli(180) : error C2433: 'PicturePtr' : 'inline' not permitted on data declarations
c:\mmap-nov-16\radar\debug\mmap.tli(180) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tli(180) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\Radar.sbr': No such file or directory
Error executing bscmake.exe.

Radar.exe - 31 error(s), 0 warning(s)


/*****************************************End the errors*********************************/


One more thing is that if I am trying with other *.ocx file, it is compiling with out any errors.But if Iam trying with mmap.ocx file only these errors are getting.
What may be the reason?

Please give reply as early as possible.
Thanks And Regards,
swetha.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #17
Dec 3rd, 2007
> C:\mmap-nov-16\Radar\Radar.cpp(8) : error C2017: illegal escape sequence
this is the first error reported by the compiler. what is this Radar.cpp file? and what does it contain? in paticular what does line 8 look like?
i repeat: create a small project which contains only a main.cpp. with only these 16 lines of code
  1. #include <cassert>
  2. #include<windows.h>
  3. #import "c:\WINNT\system32\MMap.ocx" named_guids
  4. using namespace MMAPLib;
  5.  
  6. void main()
  7. {
  8. CoInitialize( 0 );
  9. _DMMap* pMap = 0;
  10.  
  11. HRESULT hr = CoCreateInstance(CLSID_MMap, 0, CLSCTX_ALL,
  12. DIID__DMMap,reinterpret_cast <void**>(&pMap));
  13. assert(SUCCEEDED(hr));
  14. pMap->Release();
  15. CoUninitialize();
  16. }
and post the results.
also rename mmap.ocx as mmap.ocx.txt and upload that too. (click on the 'Manage Attachments' button)
Last edited by vijayan121; Dec 3rd, 2007 at 10:26 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 22
Reputation: swethakiran is an unknown quantity at this point 
Solved Threads: 0
swethakiran swethakiran is offline Offline
Newbie Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #18
Dec 3rd, 2007
radar.cpp is new/modified file name of earlier image.cpp. Both of them are same. Very sorry for the confusion. When I keep attribute named_guids, I am getting the 1st error. And, if I remove it, I am not getting it.

I am getting the following errors in mmap.tlh with the code what you mentioned. I am getting the same errors even if I keep empty main function with #import.

I sent the OCX file to your gmail ID as it's confidential file.

c:\mmap-nov-16\radar\debug\mmap.tlh(148) : error C2146: syntax error : missing ';' before identifier 'BackPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(148) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(148) : error C2501: 'BackPicture' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(164) : error C2146: syntax error : missing ';' before identifier 'Font'
c:\mmap-nov-16\radar\debug\mmap.tlh(164) : error C2501: 'FontPtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(164) : error C2501: 'Font' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(178) : error C2146: syntax error : missing ';' before identifier 'MapPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(178) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(178) : error C2501: 'MapPicture' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(260) : error C2146: syntax error : missing ';' before identifier 'ObjectPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(260) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(260) : error C2501: 'ObjectPicture' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(288) : error C2146: syntax error : missing ';' before identifier 'WaypointPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(288) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(288) : error C2501: 'WaypointPicture' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(360) : error C2146: syntax error : missing ';' before identifier 'GetBackPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(360) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(376) : error C2146: syntax error : missing ';' before identifier 'GetFont'
c:\mmap-nov-16\radar\debug\mmap.tlh(376) : error C2501: 'FontPtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(390) : error C2146: syntax error : missing ';' before identifier 'GetMapPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(390) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(472) : error C2146: syntax error : missing ';' before identifier 'GetObjectPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(472) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tlh(500) : error C2146: syntax error : missing ';' before identifier 'GetWaypointPicture'
c:\mmap-nov-16\radar\debug\mmap.tlh(500) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tli(180) : error C2143: syntax error : missing ';' before 'tag::id'
c:\mmap-nov-16\radar\debug\mmap.tli(180) : error C2433: 'PicturePtr' : 'inline' not permitted on data declarations
c:\mmap-nov-16\radar\debug\mmap.tli(180) : error C2501: 'PicturePtr' : missing storage-class or type specifiers
c:\mmap-nov-16\radar\debug\mmap.tli(180) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\Radar.sbr': No such file or directory
Error executing bscmake.exe.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #19
Dec 3rd, 2007
there is nothing wrong with the mmap.ocx file.
i have been able to #import the file and build it without errors.
note: i am NOT using precompiled headers.

however, it appears that the file is licensed, and so i get a
run-time error 'Class is not licensed for use' when i try to instantiate it.
i suppose that you have the license key with you, and you would be
able to instantiate it.

  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. #import "C:\\cygwin\\home\\projects\\ocx_read\\mmap_read\\MMap.ocx" \
  5. no_namespace no_smart_pointers raw_native_types named_guids
  6.  
  7. int main()
  8. {
  9. CoInitialize(0) ;
  10. {
  11. _DMMap* pmmap = 0 ;
  12. HRESULT hr = CoCreateInstance( CLSID_MMap, 0,
  13. CLSCTX_ALL, DIID__DMMap,
  14. reinterpret_cast<void**>(&pmmap) ) ;
  15. if( SUCCEEDED(hr) )
  16. {
  17. std::cout << "succeeded in creating an instance "
  18. "of mmap\n" ;
  19. pmmap->Release() ;
  20. }
  21. else
  22. {
  23. char strerror[128] ;
  24. FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM,
  25. 0, hr, 0, strerror, sizeof(strerror), 0 ) ;
  26. std::cout << "error: " << strerror ;
  27. }
  28. }
  29. CoUninitialize() ;
  30. }
  31. /***
  32. output:
  33. error: Class is not licensed for use
  34. */
Last edited by vijayan121; Dec 3rd, 2007 at 2:08 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 22
Reputation: swethakiran is an unknown quantity at this point 
Solved Threads: 0
swethakiran swethakiran is offline Offline
Newbie Poster

Re: How to read .ocx file in C++ (Not MFC)

 
0
  #20
Dec 5th, 2007
Hi Vijayan,

I got licensed version of the file and able to compile it successfuly. While executing it, program is quitting with "Abnormal program termination". I debugged it and it's terminating at the ollowing line/function call. Program entered into the function definition in .tlh header file and then terminated immediately.

pMP->GetMapID();

If I don't call above function in the code, it's working fine without doing anything. Also, if I keep alone pMP ->Release(); function call at the end, it's still working fine without doing anything.

Am I missing something in above function call? Or do I need to call the function differently?

Thanks a lot for ur help,
Regards,
Swetha
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC