|
purplee85 wrote: Subject:Re: [Message Deleted]
Sender:purplee85
Please never delete your message.. it could be helpful for other!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Now I have a question of you why you delete your message?
|
|
|
|
|
Hi All,
I am using VC++ win32 application in VS 2005.I have created one project as win32 and now I want to add one another project which is omnithread into same solution.I want to make it as static library.
How can I use omnithread.h,nt.h and nt.cpp files in this project.And what my project settings I have to change?Please suggest me.I tried this by reading the Readme.Win32 but I did not get success.
Can anyone test the application making new project with including other project as omnithread and use this project's classes into the ohter project in the same solution. You can download these files from the below link.
http://www.koders.com/cpp/fidB630376C86E504519D0CBF450C0AA4358CFC3915.aspx?s=omnithread.h[^]
If you get any idea or any suggetion then reply me.
Thanks in Advace.
Ashish Bhatt
|
|
|
|
|
Hmmm, where to start.
Simple answer:
#include "omnithread.h"
And add nt.cpp to your project.
Longer answer:
If you're struggling to include a header, then threads may be overly ambitious.
Bit Longer answer:
Is there a reason you're not asking on www.koders.com where the files are from? I know that *I'm* not going to make a dummy project, download those files, work out what they're about, test it, then tell you. That's the sort of thing you PAY people for.
Iain.
|
|
|
|
|
hai,
in which forum did you actually want to post this.
|
|
|
|
|
|
hai all.
that was her question.
|
|
|
|
|
So her question was a general question.;)
|
|
|
|
|
Hi all,
Anybody know, please, how i can concatenate CString with hex values?
<br />
CString message = _T("Hello");<br />
unsigned char HexPrepend[] = { 0x01, 0x02, 0x03, 0x4 };<br />
So in memory result should be:
<br />
0102030448656C6C6F<br />
Regards,
L.
|
|
|
|
|
you can use the %x to put it in the CString variable. Ex. message.Format("%x",HexPrepend[0])
|
|
|
|
|
Larrson12 wrote: So in memory result should be:
0102030448656C6C6F
thats fine,
but what memory are you referring to here.
if it is the CStrings memory, based on what Llasus has suggested, here is the clearer version.
message.Format("%02x%02x%02x%02x%s",HexPrepend[0],HexPrepend[1],HexPrepend[2],HexPrepend[3],mesage);
is that what you are exactly looking for?
Gud Luck.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
if you change the unsigned char to simply char, the below mehod will be easy.
CString message = _T("Hello");<br />
unsigned char HexPrepend[] = { 0x01, 0x02, 0x03, 0x4 };<br />
CString csNewMsg( HexPrepend, 4 );
csNewMsg += message;
or
CString message = _T("Hello");<br />
unsigned char HexPrepend[] = { 0x01, 0x02, 0x03, 0x4 };<br />
TCHAR tcMsg[100];<br />
memcpy( tcMsg, HexPrepend, 4 );<br />
memcpy( tcMsg + 4, message.operator LPCTSTR(), 5 );
|
|
|
|
|
Hi all,
First method given by Naveen.R with char only is perfect for me.
Thank you all for time.
Regards.
L.
|
|
|
|
|
You are joking right! No!
Well if you know the size of the array as shown then:
CString message;
message.Format("%s%x%x%x%x","Hello", HexPrepend[0], HexPrepend[1], HexPrepend[2], HexPrepend[3]);
That’s bad C++ (MS thing), but good C.
I could give u a dozen other examples, but I am not in the mood and a little research (very little) will answer your question.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Whenever I come here to post a question or see your discussion, I click the homepage POST A QUESTION to come here, Is there any more easy way to come to the question board?
BELOW is my question too.
what does this mean?
<br />
if (GetKeyState(VK_SHIFT) & 0x8000)<br />
{<br />
}<br />
ACTUALLY 2 questions.
-- modified at 0:35 Thursday 1st November, 2007
|
|
|
|
|
Well personally I have this shortcut[^] on my local homepage.
GetKeyState(...) returns a short, if the requested key is down then the high order bit is 1, so by masking the returned short with 0x8000 the result tested by if will be zero if the key is up and non-zero if the key is down ignoring all the bits which you dont care about because you only want to know if the shift key is down.
|
|
|
|
|
fantasy1215 wrote: if (GetKeyState(VK_SHIFT) & 0x8000)
Means the key should be kept pressed.
- NS -
|
|
|
|
|
Then does this code means clearly?
<br />
BOOL bShiftKeyDown = GetKeyState(VK_SHIFT) < 0;<br />
if (bShiftKeyDown)<br />
{<br />
}<br />
thx you all, I understand GetKeyState more clearly.
|
|
|
|
|
May be...
But actually the bit is checked there. Not simply its value. You will understand it clear from MSDN documentation regarding this. See this...
Return Value
The return value specifies the status of the specified virtual key, as follows:
. If the high-order bit is 1, the key is down; otherwise, it is up.
. If the low-order bit is 1, the key is toggled. A key, such as the CAPS LOCK key, is toggled if it is turned on. The key is off and untoggled if the low-order bit is 0. A toggle key's indicator light (if any) on the keyboard will be on when the key is toggled, and off when the key is untoggled.
- NS -
|
|
|
|
|
The high-order bit (0x8000) is the sign bit in a short variable. If it is on, then the value is < 0. This does the same thing as the code you posted earlier - it's just not as clear in this case. The earlier one would be preferable, IMHO, since it is obvious that you are testing for the state of the high-order bit.
Judy
|
|
|
|
|
I have been given a .NET Dll which I have to intergrate into and MFC solution. It sort of worked when I added it to Microsoft sample MFC04.exe sample, and imported it into one of it's Dlls. It gave a problem with passing strings to the MFC code but that should be easy to overcome.
Creating a new project in the existing solution with the same settings first gave build error with unresolved external (the lib file never was built).
Finally it builds but at runtime I get this:
Debugger:: An unhandled non-continuable exception was thrown during process load
The program '[2436] AppMgr.exe: Native' has exited with code -1073741511 (0xc0000139).
Any assistance, suggestions to get round this would be most welcome.
Happy programming!!
|
|
|
|
|
do u use
#using <dllname>
using namespace <dllname>
and then compiling with clr option?
calling .net dll from mfc dll has a mixed dll loading problem. but works if u use in a mfc app.
Prasann
|
|
|
|
|
i mean
#using dllname
using namespace dllname
|
|
|
|
|
What is the lib file you refer to?
Dynamically linking a .NET assembly has nothing to do
with a lib file.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That's interesting, cause the Microsoft example generates a lib for ".NET/MFC interface" Dll and links with it. The interface Dll uses the namespace for the .NET, yes, and that part works when I add it to the Microsoft sample. That Dll (Which is an MCF extension) then exports a C/C++ function which accesses the .NET dll.
The error I'm getting now seems to be to with initialization when the dll is being loaded. It is trying to initialize both the managed and unmanaged code at the same time, and this is apparently a no-no.
How can I get around this? It's much work to work to rewrite the umpteen other files in the solution.
Happy programming!!
|
|
|
|