|
Hmm... it did go to an (almost) identical post about 24 hours earlier, with a solution, but it's been erased.
|
|
|
|
|
Hi.
I have created one Dialog based application and on the dialog box I have created some edit boxes. Being a Dialog based application; I don’t have a class derived from CView class in my application.
I want to provide the facility by which I can drag the text from one of the edit box and drop it in some another application.
How can I incorporate the facility of drag and drop in this case as I need to handle
1. OnDrag()
2. OnDragEnter()
3. 3. OnDragOver()
4. OnDragLeave()
5. OnDrop()
Function from View class and as I said I dont have View class in my application?
Thanks.
Rakesh
|
|
|
|
|
|
Hi Billy.
Thanks for reply.
But as I mentioned; my application don't have view class rather its a dialog based appli. So I can't use the function that are mentioned in the document u forwarded me because these function are there in CView class.
How can I proceed then?
Please help
Thansk
Rakesh
|
|
|
|
|
You do not need the CView class. Follow the instructions on the page and sub-pages that I linked.
Drop Source:
[quote]
Otherwise, construct a COleDataSource object, initialize it with the selection, and call the data source object's DoDragDrop member function
[/quote]
Drop Target
[quote]
To implement a drop target
Add a member variable to each view in the application that you want to be a drop target. This member variable must be of type COleDropTarget or a class derived from it.
From your view class's function that handles the WM_CREATE message (typically OnCreate), call the new member variable's Register member function. Revoke will be called automatically for you when your view is destroyed.
Override the following functions. If you want the same behavior throughout your application, override these functions in your view class. If you want to modify behavior in isolated cases or want to enable dropping on non-CView windows, override these functions in your COleDropTarget-derived class.
Override To allow
OnDragEnter
Drop operations to occur in the window. Called when the cursor first enters the window.
OnDragLeave
Special behavior when the drag operation leaves the specified window.
OnDragOver
Drop operations to occur in the window. Called when the cursor is being dragged across the window.
OnDrop
Handling of data being dropped into the specified window.
OnScrollBy
Special behavior for when scrolling is necessary in the target window.
[/quote]
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
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
|
|
|
|