Results 1 to 6 of 6

Thread: c++ compiler error

  1. #1
    Join Date
    Sep 2002
    Location
    Québec, Canada
    Posts
    27

    Default c++ compiler error

    1- CWMSetting theDlg;
    2- theDlg.SetParent(this);
    3- theDlg.DoModal();

    I got the error :
    error C2664: 'SetParent' : cannot convert parameter 1 from 'class CGen_uirApp *const ' to 'class CWnd *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

    What is my problem?

  2. #2
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,400

    Default

    Oh my,.. you are using the MFC :-) I wresteled with that problem for a short while too. I'd advise you to take a look at Mark's plugins, he has been so kind to release the source code ( see the developers page ). I learned a lot from the way he did this.

    I think I used popup OSD as a reference.

    Basically he changed the Create ( if i remember correctly ) to accept the App object instead of the CWnd parent.
    Ron
    No support through PM

  3. #3
    Join Date
    Sep 2002
    Location
    Québec, Canada
    Posts
    27

    Default

    I start this week doing my plugin and I'm using one of Mark's plugin the serial.... as example. Just after I send my message I found a way to solve my problem in Mark's plugin.

    But I still have a probleme when a press the setting button who call the config function my windows don't want to show up. If you have any advice for that to let me know.

    Thank!

  4. #4
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,400

    Default

    Make sure that you are running your windows in a separate thread. You are not allowed to use the Girder thread for this. ( cause it don't work ;-) )
    Ron
    No support through PM

  5. #5
    Join Date
    Sep 2002
    Location
    Québec, Canada
    Posts
    27

    Default

    How can I make sure that I'm running my windows in a separate thread?

    Thank

  6. #6
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,400

    Default

    Take a look at Mark's example.
    Ron
    No support through PM

Posting Permissions

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