Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing HWND as a parameter via constructor or function

Posted on 1998-07-02
2
Medium Priority
?
340 Views
Last Modified: 2008-03-06
How can I pass the HWND of the main window via a constructor or function from the winmain to a class.  when I do I get the following error upon linking:

error LNK2001: unresolved external symbol "public: void __thiscall FileDialog::OpenTheFile(struct HWND__ *)" (?OpenTheFile@FileDialog@@QAEXPAUHWND__@@@Z)

thanks in advance.
0
Comment
Question by:rgrandid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Expert Comment

by:Arkadiy
ID: 1167071
Can you please provide more info? Class declaration and function implementation would be most helpful.
0
 
LVL 23

Accepted Solution

by:
chensu earned 20 total points
ID: 1167072
It seems that you declare FileDialog::OpenTheFile member function in the header file but forget to specify FileDialog when you define OpenTheFile function in the source file.

Is your code like this?

void OpenTheFile(HWND)
{
    // your code here
    // ...
}

It should be like this.

void FileDialog::OpenTheFile(HWND)
{
    // your code here
    // ...
}

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question