Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Passing HWND as a parameter via constructor or function

Posted on 1998-07-02
2
Medium Priority
?
343 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
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.
Suggested Courses

927 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