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
Solved

Passing HWND as a parameter via constructor or function

Posted on 1998-07-02
2
336 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 10 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

808 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