|
One of the things that I did for JRTSTools was to create a COleDropTarget -based class that uses registered messages for notifications to its "notification" window (the class treats the owner control/window and the notification window separately).
That way, it is completely reusable for any type of (non-CView -based) window - all that has to be done is adding the registered window message handlers.
I find it easier than creating a new class derived from COleDropTarget each time I need to add a drop target (or multiple drop targets) to a window - I have have just add the instances of the object, and wire-up the targets and notification window. Easier than creating two derived versions or using one and managing drag locations to determine behavior.
It also makes it easier to add or remove the drop target functionality at runtime based on other activity in the window.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
can somebody help me..
How to get the handle(HWND)of the window (dialog box)? i have tried the GetSafeHwnd()but as i don't have the Cwnd pointer also so that i can call this function . So how to get the CWnd pointer for that specific window?
|
|
|
|
|
|
What do you need to get, an HWND or a CWnd pointer? Is the dialog in your app?
|
|
|
|
|
Use
HWND hand= GetSafeHwnd();
CWnd* pWnd= CWnd::FromHandle();
redindian
|
|
|
|
|
You do not need CWnd to call ::GetSafeHWnd()
::GetSafeHwnd() is a win32 API
CWnd::GetSafeHWnd is the same but MFC wrapped .
redindian
|
|
|
|
|
Hi Friends,
I am new to this discussion.
I am facing Linker error while building my project.
Error is:Creating library C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.lib and object C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.exp
LIBCD.lib(wwincrt0.obj) : error LNK2001: unresolved external symbol _wWinMain@16
C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.xnt : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
I have done settings like: 1) c/c++ Tab->Preproccessor->WIN32,_DEBUG,_WINDOWS,_MBCS
2) Link-> Output->wWinMainCRTStartup.
Inspite of these settings i am getting Above errors.Anybody knows, please reply me.
|
|
|
|
|
Raghavendra Pise wrote: 2) Link-> Output->wWinMainCRTStartup.
You might wanted to say Link-->Output-->Entry point symbol-->wWinMainCRTStartup
|
|
|
|
|
Hello Prasad,
Yes, I am using this setting in my project,
Link-->Output-->Entry point symbol-->wWinMainCRTStartup, but getting above errors.
I am not sure whether should i use this entry point or some other.If u know plz tell me
Raghavendra Pise
|
|
|
|
|
I think you asked this question yesterday?did you get your answer
|
|
|
|
|
Ya yesterday i asked same question but didn't get solution,
I used thse settings.
Link-->Output-->Entry point symbol-->wWinMainCRTStartup, but getting above errors.
I am not sure whether should i use this entry point(wWinMainCRTStartup) or some other.If u know plz tell me
|
|
|
|
|
See here[^] maybe its some helpful for you
|
|
|
|
|
Why you set 'entry point for UNICODE project' in a non-unicode project ??
We need not explicitly set any entry point sympol for Non-Unicode projects.
Or
If u intend make ur project UNICODE supportable then plz add 'UNICODE,_UNICODE' in c/c++ Tab->Preproccessor
|
|
|
|
|
Thanks for ur feedback.
If i am remove entry point for my project, still i a getting same errors.
Creating library C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.lib and object C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.exp
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.xnt : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
I think i should use some header file to resolve this problem.I already used <windows.h> header file.
Is there any header file, i have to include or any setting i want to do?
|
|
|
|
|
From MSDN:
If you are using Unicode and MFC, you will get an unresolved external on _WinMain@16 if you don’t create an entrypoint to wWinMainCRTStartup. Use the /ENTRY option or type this value in the Project Settings dialog box. (To find this option in the development environment, click Settings on the Project menu, then click the Link tab, and click Output in the Category box.) See Unicode Programming Summary.
See the following Knowledge Base articles located in the Online Information System for more information. An easy way to reach an article is to copy a "Q" number above, open the Search dialog box from the Help menu and select the Query tab, then paste the number into the first text box and press ENTER.
Q125750 "PRB: Error LNK2001: '_WinMain@16': Unresolved External Symbol"
Q131204 "PRB: Wrong Project Selection Causes LNK2001 on _WinMain@16"
Q100639 "Unicode Support in the Microsoft Foundation Class Library"
Truth is the subjection of reality to an individuals perception
|
|
|
|
|
Hi,
Thnaks for your feedback.
Sorry to say this, we are using DLL(BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)) in our project not main or Winmain.
May i know Which entry-point want to use in my project?
|
|
|
|
|
I am using VC++ .NET(8 Version) to build a Dialog based application, however, my
application allows user to input command arguments from the Command prompt
window.
I want to write some help message when user enters "Some.exe /?" at the command prompt. How can I write text to the command prompt window if user enters the above arguments?(Some.exe /?)
|
|
|
|
|
I dont know about .Net, but MFC implements the following:
BOOL CSetupApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CSetupDlg dlg;
m_pMainWnd = &dlg;
if(stricmp(m_lpCmdLine, "-f") == 0)
dlg.ForceInstall = TRUE;
else
dlg.ForceInstall = FALSE;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
for dialog based apps.
ie, there is an inbuilt command line to the app, that you can handle, and choose to create the dialog or, in your case, just print to standard out.
Perhaps .Net has a similar mechanism.
Truth is the subjection of reality to an individuals perception
|
|
|
|
|
hi all,
can anybody help me on Differential Backup policy algorithm?
i want just algorithm for implement it on MFC.
Thanks & Regards
rakesh baldha
|
|
|
|
|
Can you help me to know about the following dlls?
1.NSInst.dll
2.CPUID32.DLL
Actually as per my knowledge these dlls are used during creation
of installer setup file.But I don't know the exact purpose of these
dlls.If you have any resources or site link which can help me in
in this regard then please forward that to me.
With Regards
Neeraj Sinha
Netstudio
Pune
|
|
|
|
|
From where you download these files?
|
|
|
|
|
There are two classes in my case, Class_A and Class_B. In Class_A.h, a Class_B member variable is declared. Hence, #include "Class_B.h" is put into Class_A.h. In Class_B.h, On the other hand, a Class_A member variable is declared. Hence, #include "Class_A.h" is put into Class_B.h.
However, the above arragement will cause C2146, C2501 errors. How to solve this dilemma.
Thanks,
|
|
|
|
|
There's a couple of ways around the circular dependency problem:
a) Put your declarations in .h and put your definitions in .cpp.
b) Declare your classes, then in the same .h, put the definitions with the dependencies outside of the class.
a)
.h:
class Class_A;<br />
class Class_B;<br />
<br />
class Class_A<br />
{<br />
Class_B* _b;<br />
<br />
void func();<br />
};<br />
<br />
class Class_B<br />
{<br />
Class_A* _a;<br />
<br />
void func();<br />
};<br />
.cpp:
void Class_A::func()<br />
{<br />
_b->func();<br />
}<br />
<br />
void Class_B::func()<br />
{<br />
_a->func();<br />
}<br />
b)
.h:
class Class_A;<br />
class Class_B;<br />
<br />
class Class_A<br />
{<br />
Class_B* _b;<br />
<br />
void func();<br />
};<br />
<br />
class Class_B<br />
{<br />
Class_A* _a;<br />
<br />
void func();<br />
};<br />
<br />
<br />
void Class_A::func()<br />
{<br />
_b->func();<br />
}<br />
<br />
void Class_B::func()<br />
{<br />
_a->func();<br />
}<br />
In either case, the classes are declared, then the class functions are defined after they're declared.
-- modified at 2:31 Tuesday 7th November, 2006
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
You certainly meant Class_A* _a and Class_B* _b for the class declaration, no ? Otherwise, if you don't work with pointer this won't work.
|
|
|
|
|
Oops! Yes. That's what I meant. My fingers got going a little too fast on the keyboard.
Thanks!
- S
50 cups of coffee and you know it's on!
|
|
|
|