Error converting VS6 project to VS2008 Pro

Experts,

I'm converting a VS6 project to VS2008 Pro project using the VS08 Wizard.  After correcting all the compile errors, I was able to compile it.  This project has to do with watching TV on a PC.  It works fine in VS6.  After I converted to VS08, when I run the app, it said member not found and open up the TV window with no channel (rainy screen).  Below is the code snipets and where the program crashes.  TIA.

MyTest.h:
class CMyTestApp : public CWinApp
{
public:
      CMyTestApp ();
// Overrides
      // ClassWizard generated virtual function overrides
      //{{AFX_VIRTUAL(CMyTestApp )
      public:
      virtual BOOL InitInstance();
      //}}AFX_VIRTUAL
                     ....
      DECLARE_MESSAGE_MAP()
};

MyTest.cpp:
...
#include "stdafx.h"
#include "MyTest.h"
#include "MyTestDlg.h"

BOOL CMyTestApp::InitInstance()
{
      if (!AfxSocketInit())
      {
            AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
            return FALSE;
      }
      AfxEnableControlContainer();
                      ...
      CMyTestDlg dlg;
      m_pMainWnd = &dlg;

      int nResponse = dlg.DoModal();
      if (nResponse == IDOK)
      {
      }
      else if (nResponse == IDCANCEL)
      {
      }
      return FALSE;
}

MyTestDlg.h:
//{{AFX_INCLUDES()
#include "_hcwwintvocx.h"
//}}AFX_INCLUDES
class CMyTestDlg : public CDialog
{
public:
      ...
      void SetChannel(int channel);
                     CMyTestDlg(CWnd* pParent = NULL);
                    // Dialog Data
      //{{AFX_DATA(CMyTestDlg )
      enum { IDD = IDD_MYTV };
      C_hcwWinTVocx      m_TV;
      //}}AFX_DATA
      
      // ClassWizard generated virtual function overrides
      //{{AFX_VIRTUAL(CMyTestDlg)
      protected:
      virtual void DoDataExchange(CDataExchange* pDX);      // DDX/DDV support
      //}}AFX_VIRTUAL
                     ....
protected:
      HICON m_hIcon;
                     ....
private:
                     int m_chnl;
                     .....
};

MyTestDlg.cpp:
#include "stdafx.h"
#include "MyTestDlg.h"

CMyTestDlg::CMyTestDlg(CWnd* pParent /*=NULL*/)
      : CDialog(CMyTestDlg::IDD, pParent),
        m_chnl( 0 ),
                       ....
{
      //{{AFX_DATA_INIT(CMonitorDlg)
      //}}AFX_DATA_INIT
      // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
      m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CMyTestDlg::DoDataExchange(CDataExchange* pDX)
{
      CDialog::DoDataExchange(pDX);
      //{{AFX_DATA_MAP(CMyTestDlg)
      DDX_Control(pDX, IDC_TV, m_TV);
      //}}AFX_DATA_MAP
}
...
BOOL CMyTestDlg::OnInitDialog()
{      
      CDialog::OnInitDialog();
      SetWindowText( "MY TV" );
      SetIcon(m_hIcon, TRUE);            // Set big icon

      m_TV.SetAnnunciatorEnabled( FALSE);      <<<< The program crashes right here   as soon as I start using m_TV object.
                     ....
}

Here is the _hcwwintvocx.h file (comes with the TVTuner)
class C_hcwWinTVocx : public CWnd
{
protected:
      DECLARE_DYNCREATE(C_hcwWinTVocx)
public:
      CLSID const& GetClsid()
      {
            static CLSID const clsid
                  = { 0x79ecb87e, 0x1510, 0x11d2, { 0xa9, 0x82, 0x0, 0xa0, 0xc9, 0x2a, 0x2d, 0xf } };
            return clsid;
      }
      virtual BOOL Create(LPCTSTR lpszClassName,
            LPCTSTR lpszWindowName, DWORD dwStyle,
            const RECT& rect,
            CWnd* pParentWnd, UINT nID,
            CCreateContext* pContext = NULL)
      { return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
            const RECT& rect, CWnd* pParentWnd, UINT nID,
            CFile* pPersist = NULL, BOOL bStorage = FALSE,
            BSTR bstrLicKey = NULL)
      { return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
            pPersist, bStorage, bstrLicKey); }

// Operations
public:
                   void SetAnnunciatorEnabled(BOOL bNewValue);
                   .....
};

_hcwwintvocx.cpp file
#include "stdafx.h"
#include "_hcwwintvocx.h"
IMPLEMENT_DYNCREATE(C_hcwWinTVocx, CWnd)
....
void C_hcwWinTVocx::SetAnnunciatorEnabled(BOOL bNewValue)
{
      static BYTE parms[] =
            VTS_BOOL;
      InvokeHelper(0x6803ffce, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
             bNewValue);
}
....
LVL 1
TommyN14Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
>>when I run the app, it said member not found

It seems that the DISPID you are using with 'InvokeHelper()' is no longer valid. Have you tried regenerating the OLE wrappers?
0
TommyN14Author Commented:
jkr,

Thanks for your response.  I digged into the HCW OCX documentation and it said to select the hcwWinTVocx from Project->Add to Project->Components and Controls...(in VS6) and it will generate the _hcwwintvocx files.  I tried to do the samething in VS2008, but I couldn't find the Components & Controls options.  So I went to right click on the Toolbox->Choose Items...->COM Components and select that hcwWinTVocx, but it didn't regenerate the _hcwwintvocx files.  After this, I went to Resource View of the project and open the Diaglog IDD_MYTV and it crashed/shutdown VS2008.  Do you have any idea how I can regenerate these files or the OLE wrappers u mentioned?

Thanks!
0
jkrCommented:
Have you tried 'Project|Add Class...'?
0
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

TommyN14Author Commented:
jkr,

I tried Add Class as you suggested, this is what I did:  Project->Add Class->MFC Class From ActiveX Control.  In the Add Class From ActiveX Control Wizard window, I select the hcwWinTVocx (from registry), it doesn't show any Intefaces, so I can't select any interface to generate any class.  Am I doing something wrong here?

Thanks!
0
TommyN14Author Commented:
jkr, do you have anymore suggestions?

Anyone else has any ideas?

Please help!!!  Thanks!
0
jkrCommented:
Can you check the module in question with OLEView?
0
TommyN14Author Commented:
jkr,

How do I do that?

Thanks!
0
TommyN14Author Commented:
jdk,

so I ran the OLEView and under Interfaces, i saw about a doze of hcwWinTVocx, i select each of them and they have different info.  I don't know what to look for.  Attached is an example of one of them.

Please help.  Thanks!

test.gif
0
jkrCommented:
Can you try to "Generate IDL" from OLEView? BTW, that OCX control seems to be more than outdated: http://www.hauppauge.com/html/sw_wintv881.htm says "File name: wintvocx20_19337.exe Updated: Aug. 16, 2001 "
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TommyN14Author Commented:
I don't see any option from OLEView to generate IDL.  How do i do that?

Thanks!
0
TommyN14Author Commented:
Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.