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. ATL / WTL / STL
  4. convertion vc6 to dotnet2008

convertion vc6 to dotnet2008

Scheduled Pinned Locked Moved ATL / WTL / STL
c++csharphelpquestion
20 Posts 3 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.
  • S Stuart Dootson

    Rajeesh MP wrote:

    if i am adding a class to my ATL application...that class id will generate automatically in our ABC_i.h....

    Fine - we agree on that :-)

    Rajeesh MP wrote:

    but i m trying to add my existing file to my application...After compiling time this existing CLASSID is not generating in our ABC_i.h

    By 'existing file', I presume you mean the IDL file that contains that class and interface definition? Or not?

    Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

    R Offline
    R Offline
    Rajeesh MP
    wrote on last edited by
    #11

    Good MOrning...Stuart NO...directly i m adding ABCD.cpp and ABCD.h file why..there is no other post...??only we are here...ha ha ha Mr.Staurt ..can u add me on ur personel mail... my id rajeeshmp@gmail.com Regards, Rajeesh MP

    modified on Wednesday, April 22, 2009 12:16 AM

    S 1 Reply Last reply
    0
    • R Rajeesh MP

      Good MOrning...Stuart NO...directly i m adding ABCD.cpp and ABCD.h file why..there is no other post...??only we are here...ha ha ha Mr.Staurt ..can u add me on ur personel mail... my id rajeeshmp@gmail.com Regards, Rajeesh MP

      modified on Wednesday, April 22, 2009 12:16 AM

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #12

      Rajeesh MP wrote:

      NO...directly i m adding ABCD.cpp and ABCD.h file

      OK - finally, I think I'm clear on why you're having these problems :-) So...let me tell you what I've done and let's see if that helps. I first created an ActiveX project called "ax-ctrl", with a simple ActiveX object called "test". That built fine. It contained files test.h and test.cpp (for the object) and axctrl_i.c and axctrl_i.h (for the ActiveX library). I then created another ActiveX project called "ax-copy" and added test.cpp and test.h to that without moving them from the existing project. When I built that project, it complained about missing symbols like this:

      3>test.obj : error LNK2001: unresolved external symbol _IID_Itest
      3>test.obj : error LNK2001: unresolved external symbol _LIBID_axctrlLib

      I then added axctrl_i.c to the ax-copy project and (after telling it not to use precompiled headers) it worked fine.

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      R 1 Reply Last reply
      0
      • S Stuart Dootson

        Rajeesh MP wrote:

        NO...directly i m adding ABCD.cpp and ABCD.h file

        OK - finally, I think I'm clear on why you're having these problems :-) So...let me tell you what I've done and let's see if that helps. I first created an ActiveX project called "ax-ctrl", with a simple ActiveX object called "test". That built fine. It contained files test.h and test.cpp (for the object) and axctrl_i.c and axctrl_i.h (for the ActiveX library). I then created another ActiveX project called "ax-copy" and added test.cpp and test.h to that without moving them from the existing project. When I built that project, it complained about missing symbols like this:

        3>test.obj : error LNK2001: unresolved external symbol _IID_Itest
        3>test.obj : error LNK2001: unresolved external symbol _LIBID_axctrlLib

        I then added axctrl_i.c to the ax-copy project and (after telling it not to use precompiled headers) it worked fine.

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        R Offline
        R Offline
        Rajeesh MP
        wrote on last edited by
        #13

        Ha Ha Ha... my application is working same way only... before posting this message...i done this..and its working fine... but i would like to know any alternate trik is there or not..like adding reference or linking....etc Thank u Stuart Rajeesh MP

        R S 2 Replies Last reply
        0
        • R Rajeesh MP

          Ha Ha Ha... my application is working same way only... before posting this message...i done this..and its working fine... but i would like to know any alternate trik is there or not..like adding reference or linking....etc Thank u Stuart Rajeesh MP

          R Offline
          R Offline
          Rajeesh MP
          wrote on last edited by
          #14

          Good Morning Mr.Stuart :) if i m creating a dll with ATl dotnet2008. that we can register in regscr 32 /i "dll path"...am i right..???:confused: my old c++ application like this (ABC.cpp)

          CComModule _Module;

          BEGIN_OBJECT_MAP(ObjectMap)
          OBJECT_ENTRY(CLSID_ABCD, CABCD)
          END_OBJECT_MAP()

          /////////////////////////////////////////////////////////////////////////////
          // DLL Entry Point

          extern "C"
          BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
          {
          if (dwReason == DLL_PROCESS_ATTACH)
          {
          _Module.Init(ObjectMap, hInstance, &LIBID_ABCLib);
          DisableThreadLibraryCalls(hInstance);
          }
          else if (dwReason == DLL_PROCESS_DETACH)
          _Module.Term();
          return TRUE; // ok
          }

          but now i m converting this to new application with ATL dotnet2008. ;P so in my dllmain.cpp contains :-\

          CABCModule _AtlModule;
          //DLL Entry Point
          extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
          {
          hInstance;
          return _AtlModule.DllMain(dwReason, lpReserved);
          }

          and ABCD.h contains :doh:

          OBJECT_ENTRY_AUTO(__uuidof(ABCD), CABCD)

          My new ATL appliation is successfully succeeded.. regscr 32 /i "dll path" i can register like this..no error:rose: After registering my AIM is not getting..its not working.. :zzz: i m feeling this above code conversion is not proper.. so mr.Stuart please :laugh: check this code and let me know.. Thanks Rajeesh MP

          S 1 Reply Last reply
          0
          • R Rajeesh MP

            Ha Ha Ha... my application is working same way only... before posting this message...i done this..and its working fine... but i would like to know any alternate trik is there or not..like adding reference or linking....etc Thank u Stuart Rajeesh MP

            S Offline
            S Offline
            Stuart Dootson
            wrote on last edited by
            #15

            Rajeesh MP wrote:

            but i would like to know any alternate trik is there or not..like adding reference or linking

            Not really - building the UUID directly into the code is hte best way.

            Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

            R 1 Reply Last reply
            0
            • R Rajeesh MP

              Good Morning Mr.Stuart :) if i m creating a dll with ATl dotnet2008. that we can register in regscr 32 /i "dll path"...am i right..???:confused: my old c++ application like this (ABC.cpp)

              CComModule _Module;

              BEGIN_OBJECT_MAP(ObjectMap)
              OBJECT_ENTRY(CLSID_ABCD, CABCD)
              END_OBJECT_MAP()

              /////////////////////////////////////////////////////////////////////////////
              // DLL Entry Point

              extern "C"
              BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
              {
              if (dwReason == DLL_PROCESS_ATTACH)
              {
              _Module.Init(ObjectMap, hInstance, &LIBID_ABCLib);
              DisableThreadLibraryCalls(hInstance);
              }
              else if (dwReason == DLL_PROCESS_DETACH)
              _Module.Term();
              return TRUE; // ok
              }

              but now i m converting this to new application with ATL dotnet2008. ;P so in my dllmain.cpp contains :-\

              CABCModule _AtlModule;
              //DLL Entry Point
              extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
              {
              hInstance;
              return _AtlModule.DllMain(dwReason, lpReserved);
              }

              and ABCD.h contains :doh:

              OBJECT_ENTRY_AUTO(__uuidof(ABCD), CABCD)

              My new ATL appliation is successfully succeeded.. regscr 32 /i "dll path" i can register like this..no error:rose: After registering my AIM is not getting..its not working.. :zzz: i m feeling this above code conversion is not proper.. so mr.Stuart please :laugh: check this code and let me know.. Thanks Rajeesh MP

              S Offline
              S Offline
              Stuart Dootson
              wrote on last edited by
              #16

              Rajeesh MP wrote:

              so in my dllmain.cpp contains

              DllMain doesn't really matter - when regsvr32 registers a control, it calls DllRegisterServer, which you should find in one of your other cpp files.

              Rajeesh MP wrote:

              After registering my AIM is not getting

              AIM? As in messaging?

              Rajeesh MP wrote:

              i m feeling this above code conversion is not proper..

              If it's ATL generated code, then I'm confident it's OK. The issue is more likely to be with the control registration data (the rgs files). Check that the CLSIDs and paths in those are OK Then you can open the registry (with regedit) and check that the registration in there is OK.

              Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

              1 Reply Last reply
              0
              • S Stuart Dootson

                Rajeesh MP wrote:

                but i would like to know any alternate trik is there or not..like adding reference or linking

                Not really - building the UUID directly into the code is hte best way.

                Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                R Offline
                R Offline
                Rajeesh MP
                wrote on last edited by
                #17

                HI..Stuart My ATL 2008 application dllmain is contains

                CABCModule _AtlModule;

                abc.cpp is having

                STDAPI DllRegisterServer(void)
                {
                // registers object, typelib and all interfaces in typelib
                HRESULT hr = _AtlModule.DllRegisterServer();
                return hr;
                }

                // DllUnregisterServer - Removes entries from the system registry
                STDAPI DllUnregisterServer(void)
                {
                HRESULT hr = _AtlModule.DllUnregisterServer();
                return hr;
                }

                but my old application is

                CComModule _Module;

                BEGIN_OBJECT_MAP(ObjectMap)
                OBJECT_ENTRY(CLSID_ABCPP, CABCPP)
                END_OBJECT_MAP()

                STDAPI DllRegisterServer(void)
                {
                // registers object, typelib and all interfaces in typelib
                return _Module.RegisterServer(TRUE);
                }

                /////////////////////////////////////////////////////////////////////////////
                // DllUnregisterServer - Removes entries from the system registry

                STDAPI DllUnregisterServer(void)
                {
                return _Module.UnregisterServer(TRUE);
                }

                any difference is there this two codes..?? what s the difference b/w ... CABCModule _AtlModule; and CComModule _Module;:confused: i think becouse of this my dll is not working properly.. :zzz: how do i create CComModule _Module; project..in ATL dotnet2008..:confused: Regards Rajeesh MP

                S 1 Reply Last reply
                0
                • R Rajeesh MP

                  HI..Stuart My ATL 2008 application dllmain is contains

                  CABCModule _AtlModule;

                  abc.cpp is having

                  STDAPI DllRegisterServer(void)
                  {
                  // registers object, typelib and all interfaces in typelib
                  HRESULT hr = _AtlModule.DllRegisterServer();
                  return hr;
                  }

                  // DllUnregisterServer - Removes entries from the system registry
                  STDAPI DllUnregisterServer(void)
                  {
                  HRESULT hr = _AtlModule.DllUnregisterServer();
                  return hr;
                  }

                  but my old application is

                  CComModule _Module;

                  BEGIN_OBJECT_MAP(ObjectMap)
                  OBJECT_ENTRY(CLSID_ABCPP, CABCPP)
                  END_OBJECT_MAP()

                  STDAPI DllRegisterServer(void)
                  {
                  // registers object, typelib and all interfaces in typelib
                  return _Module.RegisterServer(TRUE);
                  }

                  /////////////////////////////////////////////////////////////////////////////
                  // DllUnregisterServer - Removes entries from the system registry

                  STDAPI DllUnregisterServer(void)
                  {
                  return _Module.UnregisterServer(TRUE);
                  }

                  any difference is there this two codes..?? what s the difference b/w ... CABCModule _AtlModule; and CComModule _Module;:confused: i think becouse of this my dll is not working properly.. :zzz: how do i create CComModule _Module; project..in ATL dotnet2008..:confused: Regards Rajeesh MP

                  S Offline
                  S Offline
                  Stuart Dootson
                  wrote on last edited by
                  #18

                  Rajeesh MP wrote:

                  CABCModule _AtlModule; and CComModule _Module

                  The ATL module classes changed. Not a big deal.

                  Rajeesh MP wrote:

                  i think becouse of this my dll is not working properly

                  And why do you think your dll isn't working - what evidence do you have?

                  Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                  R 1 Reply Last reply
                  0
                  • S Stuart Dootson

                    Rajeesh MP wrote:

                    CABCModule _AtlModule; and CComModule _Module

                    The ATL module classes changed. Not a big deal.

                    Rajeesh MP wrote:

                    i think becouse of this my dll is not working properly

                    And why do you think your dll isn't working - what evidence do you have?

                    Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                    R Offline
                    R Offline
                    Rajeesh MP
                    wrote on last edited by
                    #19

                    can u send me...ur personel ID... rajeeshmp@gmail.com

                    1 Reply Last reply
                    0
                    • R Rajeesh MP

                      Dear Stuart Uuid is same only.. i have a doubt

                      #ifndef __AppFastLib_LIBRARY_DEFINED__
                      #define __AppFastLib_LIBRARY_DEFINED__

                      /* library AppFastLib */
                      /* [helpstring][version][uuid] */

                      EXTERN_C const IID LIBID_AppFastLib;
                      #endif /* __AppFastLib_LIBRARY_DEFINED__ */

                      /* Additional Prototypes for ALL interfaces */

                      this is generating at compiling time in ABC_i.h if i m manualy trying to add my code. That would be deleted...

                      EXTERN_C const CLSID CLSID_ABC;
                      #ifdef __cplusplus
                      class DECLSPEC_UUID("97676011-B0FA-40cf-AECC-7BD3FF54BE4E")
                      ABC;
                      #endif

                      how do i add this class instant in ABC_i.h Regards Rajeesh

                      R Offline
                      R Offline
                      rana ray
                      wrote on last edited by
                      #20

                      did you solve it or not? I am into same kind of project and need help.

                      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