|
Please help, i don't know how to get coordinates when a user click on an image.
|
|
|
|
|
You get them in the parameters provided with the WM_LBUTTONDOWN [^] message.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
+5, You might be right but the problematic part can easily be the position of the image that is drawn with whatever method...
|
|
|
|
|
Well obviously knowing the co-ordinates of the image is a pre-requisite, but as with so many questions there is a serious lack of detail.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
What kind of image? What kind of coordinates? Without the context its impossible to answer your question, please be a bit more specific!
|
|
|
|
|
All these packets are to be loaded on cars. The cars are lined in order, so that the packet could be loaded on them. The cars are also named [A, B, C, D, E,………….]. Each Car will load the packet with the same alphabet. So, for example, car ‘A’ will load all the packets with name ‘A’. Each particular car will come at the loading point only once. The cars will come at the loading point in alphabetical order. So, car ‘B’ will come and take all the packets with name ‘B’ from the shelf, then car ‘C’ will come. No matter how deep in the shelf any packet ‘B’ is, all of the ‘B’ packets will be displaced before the ‘C’ car arrives. For that purpose, some additional shelves are provided. The packets which are after the packet B, are kept in those shelves. Any one of these shelves contains only packets, having the same name. For example, if any particular shelf is used and if a packet with name X is in it, then only the packets having names X will be kept in it. That shelf will look like [XXXXXXX]. If any shelf is used once, then it could be used again only if it is vacant. Packets from the initial shelf could be unloaded from top only. Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.
|
|
|
|
|
naveen sai wrote: Write a program that ... No, that is what you are supposed to do; this site does not provide on-demand solutions to homework questions.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
can anyone please explain the practical Use of Overlapped structure in I/O operations in serial communication and when,where and why should we use the same?
|
|
|
|
|
Lots of help here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I have read many articles but failed to understand that winRT is based on Win32 Platform or Managed Framework Platform or a alternate to MFC.
Regards,
Vishal
|
|
|
|
|
Try the correct forum[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi all,
can plase suggest mi how can i play a video using data in buffer or Stream in my mfc dialog based application.
thanks.
|
|
|
|
|
Some suggestions here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) content);
content = (Content *) GetWindowLongPtr(hWnd, GWLP_USERDATA);
the above code works in window created using CreateWindow, but the same code fails when used with DialogBox.
Is there any alternative to this. I want to store Pointer to a structure.
using Win32 C++.
please guide.
Regards,
Vishal
|
|
|
|
|
Long ago I used SetProp()[^], GetProp()[^], and RemoveProp()[^]. Try them, they might work.
EDIT: On the page of SetProp() read the comments at the bottom of the page, contains important info!
|
|
|
|
|
You can try using DWLP_USER as described here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Using VS2008, I created a dialog based app using the default project settings. The only control on the dialog was a Calendar Control (SysMonthCal32). When ran, the calendar was blah in terms of color (mostly white) and depth (flat). I called CMonthCalCtrl::SetColor() with all five regions set to red. No change. Thinking it had something to do with the common control manifest, I created an identical project, with the only difference being I unchecked the Common Control Manifest checkbox when creating the project. When ran, the calendar had color and definition. Comparing the compiler and linker settings of two projects turned up no differences. The one difference I did find was in the manifest file: the first project had an extra <dependency> section with reference to the common control library, whereas the second project did not. The linker settings of the second project had Generate Manifest set to Yes even though I unchecked that setting during creation. In the first project, if I set Generate Manifest to No, the manifest file is not updated, and I get a runtime error about mfc90ud.dll. I'm not overly familar with manifests and the common control library (obviously), so this has been a tad confusing to me. Any clues as to what might be going on here?
Thanks.
- DC
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 1-Sep-12 12:43pm.
|
|
|
|
|
Did you call CommonControlsEx()[^] from InitInstance of you CWinApp derived class? If not, this should solve the problem.
|
|
|
|
|
It's not being called from either project. When I did call it from the first project (with Generate Manifest set to No), I still get an error about mfc90ud.dll being missing from my computer. So the DLL error seems to point to the Generate Manifest setting rather than the call to InitCommonControlsEx() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
Jochen Arndt wrote: Using Google, I found this: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/545d9b69-5f27-473f-b6d1-bea106cde47f/[^]
That's not a solution. It's a band-aid at best.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Please read the complete thread from my link and also the thread mentioned in the last post (the link does not work but it can be found by searching for the subject).
|
|
|
|
|
Hi,
I have a slider control on a dialog box. By default slider thumb moves by ticks when user clicks the slider bar. I want when user clicks on the slider bar, thumb should move to that position in one click not step by step. The thumb should move to the position where user clicks the mouse on the slider bar.
Anybody have any idea or sample code for the same.?
Any help will be appreciated.
Regards,
mbatra
|
|
|
|
|
Hi, I wanna develop a windows service to monitor the USB device insert/remove, and set a hook for mouse. I have successfully implemented the windows service program, I can also detection the event of USB insert/remove. But after I set the mouse hook, It seems that the system doesn't call the corresponding callback function defined in the hook. The windows service handler code is like this:
HINSTANCE hmodule = LoadLibrary(_T("MouseHookDLL.dll"));
if (hmodule == NULL)
{
WriteToLog("DLL Load Failed.");
FreeLibrary(hmodule);
return 0;
}
typedef BOOL (*pInstallHook)(HINSTANCE hmodule);
typedef BOOL (*pUnInstallHook)();
pInstallHook InstallHookFunction = (pInstallHook) GetProcAddress(hmodule, "InstallHook");
pUnInstallHook UnInstallHookFunction = (pUnInstallHook) GetProcAddress(hmodule, "UnInstallHook");
switch (evtype)
{
case DBT_DEVICEREMOVECOMPLETE:
{
WriteToLog("Remove USB Device.");
UnInstallHookFunction();
}
break;
case DBT_DEVICEARRIVAL:
{
WriteToLog("Insert USB Device.");
InstallHookFunction(hmodule);
}
break;
}
FreeLibrary(hmodule);
return 0;
In the MouseHookDLL, I defined the InstallHook(),UnInstallHook(), and the MOUSEHOOKDLL_API LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) functions. I debug the windows service program, I know I can call the InstallHook() correctly, but not the callback.
|
|
|
|
|
I wrote a numerical calculator engine in C++. It can do all the normal arithmetics, it has in-built and user defined variables and functions. The engine compiles with all the compilers I have: Visual Studio 2010 Ultimate and 2012 Ultimate RC, Embarcadero RAD Studio XE and gcc (both on linux and on Windows using mingw). But it does not give me the precision I would like to have.
Example:
Pi is defined in the program as:
3.1415926535897932384626433832795029L
When I convert it to string I got different results (the differences are in italics):
Visual Studio: 3.141592653589793 10000
Rad XE: 3.141592653589793238
gcc: 3.141592653589793238 512808959406186204433
I use long double as the data type, which for Visual Studio is the same as double that is 8 bytes long, for Rad XE it is 10 bytes (80 bits), while for gcc it is 12 bytes (where the last 2 is padding I think). The latter two compilers use the IEEE double sized numbers for long double which is 80 bits long. So the difference in accuracy is understandable.
But the calculator accessory in Windows gives
3.1415926535897932384626433832795
which is almost the same as the insanely large number of digits I entered. It misses the last 3 digits only. This means that
a) the calculator was not compiled with Microsoft compilers
b) or there is some trick which could be used to calculate with higher precision
c) or Microsoft was using some special high / arbitrary precision library
Can somebody help me to find either the tool or the method to achieve this high precision with the compilers I mentioned? Moreover I would like an open source solution, because I want to make the whole code to be open source.
|
|
|
|