|
try statically linking to the C-Runtime, ATL, and MFC...
-Change C++/Code Generation/Runtime Library from /MD to /MT.
-Change General/Use of ATL/ to "Static Link to ATL"
-Change General/Use of MFC/ to "Use MFC in a static Library"
|
|
|
|
|
I am trying to use TrackMouseEvent with a button on a dialog box created using the Resource Editor. I have tried the various sample codes examples available here on this site and on the internet.
I get some results, but not all. I keep coming up with references to subclassing the button in the literature, yet I do get WM_MOUSEMOVE & WM_MOUSELEAVE messages. When I try to subclass the button, I get an error which I interpret to mean that the button is already sub classed.
Isn't the button automatically subclassed when you use the template generated by the Resource Editor? If not and the button has to be subclassed, how do I do this.
Thanks,
Barry
|
|
|
|
|
BarryPearlman wrote: If not and the button has to be subclassed, how do I do this. Subclassing Controls. Also check here.
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I hope I chose an appropriate forum. Why does the test code below build in VS2010 as C code but not as C++ code (linker errors further below). And what's needed to make it compile as C++ code. Thanks. - Vince
#include <stdlib.h>
__declspec(dllimport) int __stdcall SetEnvironmentVariableA(const char *pName, const char *pValue);
__declspec(dllimport) unsigned long __stdcall GetEnvironmentVariableA(const char *pName, char *pValue, unsigned long nSize);
int main ( int argc, char **argv )
{
char szValue[32768];
SetEnvironmentVariableA(argv[1], argv[2]);
GetEnvironmentVariableA(argv[1], szValue, 32768);
return 0;
}
error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned long __stdcall GetEnvironmentVariableA(char const *,char *,unsigned long)" (__imp_?GetEnvironmentVariableA@@YGKPBDPADK@Z)
error LNK2001: unresolved external symbol "__declspec(dllimport) int __stdcall SetEnvironmentVariableA(char const *,char const *)" (__imp_?SetEnvironmentVariableA@@YGHPBD0@Z)
|
|
|
|
|
Got it! 'extern "C"' needed. I missed that when tracking down the defines and typedefs in WinBase.h.
|
|
|
|
|
Put declarations inside
extern "C" { }
C & C++ uses different name mangling.
|
|
|
|
|
|
What has to do with C++ (reported as spam)?
Veni, vidi, vici.
|
|
|
|
|
Nothing, apparently.
Veni, vidi, caecus | Everything summarizes to Assembly code
|
|
|
|
|
I am a student at the american university of engineering (SFAX, Tunisia) .
I am having a project about "simulating a thread scheduler with pthread" .
Really , I found several problems :
1- Is the thread lifecycle is the same as linux thread lifecyle ?
2- Can I implement my own scheduling algorithm or I must use the explicit scheduling of pthreads like (set_sched_param, ...) ??
3 - Is there a way to trace process scheduling (graphically) using C ??
Please reply asap , it's an urgent project !
Thanks
|
|
|
|
|
|
The OP is asking about POSIX threads, I believe.
Veni, vidi, vici.
|
|
|
|
|
Veni, vidi, abiit domum
|
|
|
|
|
Quote: 1- Is the thread lifecycle is the same as linux thread lifecyle ? Probably I didn't get you. Linux provides POSIX threads. That is you have to use pthread s for multithreading on Linux . In other words, don't bother about Linux threads, let's be focused on pthread s.
Quote: 2- Can I implement my own scheduling algorithm or I must use the explicit scheduling of pthreads like (set_sched_param, ...) ?? I suppose you have to implement your own scheduling algorithm. After all that's the title of your project. However you should ask to your tutor.
Quote: 3 - Is there a way to trace process scheduling (graphically) using C ?? Since you are providing the scheduling then yes, there must be a way (that is your scheduling code should provide the necessary info to build the graph. You probably have to use a library for the graphical interface (have a look at this SO question[^], for an overview).
Veni, vidi, vici.
|
|
|
|
|
Thanks , but is there any well-known way to schedule with pthreads ? (any sample code) ?
|
|
|
|
|
Of course there are well-know thread scheduling algorithms (using pthread is just a technical detail), and Google is your friend[^].
Veni, vidi, vici.
|
|
|
|
|
ok thank you very much
|
|
|
|
|
You are welcome.
Veni, vidi, vici.
|
|
|
|
|
Member 10375265 wrote: any sample code
Copy and paste is no substitute for really understanding a subject. Especially at college.
Don't use sample code, read up on the problem you are trying to solve, read up on the api you are gong to use, and design the thing yourself!
If not you will be a crap engineer.
-edit--
Actually be a crap engineer, It means more and better paid contracts for us proper engineers.
|
|
|
|
|
Hello. I don't know where to put this question so I am choosing this one (closely related).
I have a softphone. I want to setup a custom event in windows (may be playing a ringtone in WM player or something) whenever I get a call on this softphone. I need it because softphone is basic and doesn't have a ringtone feature.
I could use other softphones but was wondering if there exists such a way, may be spy++ or something(i don't know)? Thanks for any pointer.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
AmbiguousName wrote: I don't know where to put this question so I am choosing this one (closely related). How is this closely related to C++?
Veni, vidi, abiit domum
|
|
|
|
|
Richard MacCutchan wrote: How is this closely related to C++?
I thought someone from this forum could help me out.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
AmbiguousName wrote: I thought someone from this forum could help me out. With what? This is the C++ forum and I don't see anything in your question related to C++.
Veni, vidi, abiit domum
|
|
|
|
|
We've developed a component for sending and reading large messages to msmq queues for communication with Biztalk as implemented as described in this MSDN-article: http://msdn.microsoft.com/en-us/library/aa560386.aspx
Simply explained, you use the PROPID_M_EXTENSION field to describe the parts of the messages using the following content:
GUID defining that it is a multi-part message (16b) GUID for the message (16b) Total size of the entire message (4b) Current part number (2b) Number of message parts (2b) This works perfectly with Biztalk 2006, however with newer editions (2010/2013) it does not work at all.
We've sent large messages out from Biztalk 2013 to a queue and analyzed the field and it seems that the content of PROPID_M_EXTENSION is:
GUID defining that it is a multi-part message (16b) GUID for the message (16b) Part number (2b) Empty data (2b) 1 if it is the last part, otherwise 0 (1b) 3 unknown bytes The problem is the last three bytes, that we can't figure out the purpose of and how to calculate.
The values differs depending on the message content and size. And it feels like some sort of check sum, but we need to be able to set this manually.
Any ideas? There is very little information about this around the web?
The existing mqlarge-dll is in native code and can only be decompiled to assembler, which (for me at least) is hard to debug.
A way around it would be to include a reference to mqlarge in our project and use the existing assembly, but we would rather have our own code and not be dependent on a dll. And it bugs me not to know how it works as well
|
|
|
|
|
Hey there,
I have a MFC app that uses CDHtmlDialog class. It supports most of the HTML tags, but not the CANVAS tag. If am right, IE 9+ only have support for Canvas tag.
Which version of IE is used in CDHtmlDialog class?
Is there a way of using Canvas tag in CDHtmlDialog class?
If not the CDHtmlDialog class, is there any other web browser control in MFC that supports Canvas tag?
The reason why i am using CDHtmlDialog class, is to create a rich GUI using HTML/CSS/JavaScript that will be updated dynamically from the back end C++ code.
Thanks in advance.
|
|
|
|