|
the problem is that: Im using the serial port to operate GSM modem so I need my reading thread to notify me when I recieve SMS for example....and the articals here are using there own libreries..I need something standerd..
|
|
|
|
|
Hello everybody,I have just purchased Visual Studio 2005 and I have problem with the MessageBox funtion!!!
when I write for example MessageBoc("Hello") an error occurs:
cannot convert parameter 1 from 'const char [6]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
There is no problem with other functions like MessageBeep
why????
In Visual Studio 6 there is no such problem
please help
-- modified at 20:27 Tuesday 23rd May, 2006
|
|
|
|
|
I am sorry for the inconvenience but I figured out that the cause was the unicode libraries...
|
|
|
|
|
VC2005 defaults to UNICODE builds. Either turn off the UNICODE option, or use the TCHAR functions and macros
MessageBox(_T("Hello"));
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
MessageBox(_T("Hello"))
hi
|
|
|
|
|
|
Hello. I recently converted a VC6 project to 2005, and am getting the following error:
c:\myApp.cpp(1036) : error C2065: 'm_msgCur' : undeclared identifier
This error is occuring in my CWinApp derived class' Run (). In the previous version m_msgCur was a member of CWinThread, but in 2005 I can only find it in "class _AFX_THREAD_STATE : public CNoTrackObject" in afxstat.h
Can anyone shed some light on where I can get the current message under 2005? Or how this has changed?
Thanks for any thoughts.
|
|
|
|
|
How about this:
_AFX_THREAD_STATE* pState = AfxGetThreadState();
MSG msg = pState->m_msgCur;
?
gmileka
|
|
|
|
|
I need to access the cached user credentials on a Windows XP Pro machine. Specifically I need the logged in User's ID, and the Groups he/she belongs to.
On the PC the user has previously logged in to the DC and accessed it's info in AD.
Now, I need this information when the user is not logged onto the network.
I be doing alot of searches, so far with no luck.
THX
Scott
|
|
|
|
|
I migrated from VC++.Net 2002 to 2003 recently. I see that they have standardized a lot of headers .
My question is regarding this particular prolem I am not able to solve.
In 2002 , I had created a derived class from a filebuf , and had written a function called dump which will write contents of file into the console.
In my application I connect this class to cout , using the following syntax
cout = &buffer ,
buffer is instantiated as static with file desc as 1 .
THis particular setting works in 2002 but in 2003 it gives me an error as operator = not defined.
Why was this change implemented? and Is there a workaround for this ?
I have run out of ideas . I tried to use rdbuf() but it doesnt work either
|
|
|
|
|
cout (and cin, cerr) is generally defined to be a constant. Using operator= on this would be incorrect for several reasons that I won't even get into.
What exactly are you trying to do?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hey there . I want someway to connect a derived filebuf class to connect to the cout.
I try the following code
ostream file(&filebuf class)
cout.rdbuf(file.rdbuf())
These 2 lines shld connect to the cout buffer , isnt it? or am I wrong somewher?
Thanx
Darshan
|
|
|
|
|
To elaborate more clearly, there is a fileid() function in filebuf which takes an int argument. My derived class populates it with 1 , so that now its has stdout file desc. Also the constructor does an AllocConsole to open a console in an MFC application.
Now in 2002 a command like cout = &cfilebuf works
but in 2003 it does not work . I see now its a constant . But I still need to connect the buffer.
So I used the above code . I dont think that works either. Just Wondering how sync() in filebuf works?
Thanx again
|
|
|
|
|
If I understand you correctly, you are trying to open a console window from an MFC app and use it for output?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
|
You should be able to get there from this article. cout should work for it, but if it doesn't, you just need to open a new ostream to the allocated console and use that instead of cout.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
hi
I want to set Account locking duration and Threshold of Windows OS programmatically. we can set this manually in (controlpanel\ administrative tools\localsecurity policy\account policies \account lockout policy\)
i configured windows password length & max password age through NET ACCOUNTS dos command.
eg:C:>net accounts /minpwlen:12 (sets min password length as 12 char)
so is there any similar way to set account locking duration & threshold programmatically?
thanx in advance
-- modified at 14:38 Tuesday 23rd May, 2006
|
|
|
|
|
Hi !!!
Can me somebody tell, how to play audio files in C++?
Thanks.
By.
-:KNOX:-
|
|
|
|
|
hi,
C++ doesnt provide classes or methods to play audio files. you have to use a library, like OpenAl.
georg
|
|
|
|
|
I'm porting a C++ DLL from W2K Server to 2003 Server, and the data_seg(".myglobal") segment (with "/SECTION:.myglobal,rws" linker option) is no longer "sharing" data. The DLL is called from both a Windows Service program and from a VB application. On W2K, you can start the Service, start the VB app, and they both share the data in the .myglobal segment. On 2003, that no longer works - the data is no longer shared: the VB app gets it's own copy.
The Windows Service program is written so that it can be run from the command line for testing purposes and that still works, i.e., starting the Service program from the command line then starting the vb app has no problem - they share the data just fine.
Any suggestions on how to share DLL shared data between a Service program and a User program on 2003 Server? I've tried using the default data_seg("global") with no luck, and I don't know what else to try.
Thanks!
|
|
|
|
|
If my project includes 85 dlls how to enable manifest on for some of them. If you have manifest it always using COMCTRL32 vesion 6 for all projects. I tried to unload version 6 and load version 5 but it didn't work Microsoft keeps always 6 in the memory if you have manifest. Is the any way to customize usage of manifest per project?
|
|
|
|
|
The wizard generated code for MFC apps adds code to stdafx.h to tell the linker to add the 6.0 manifest specific information.
You can make sure you don't have this code for the dlls where you want to load the pre-6.0 dll. I would think that you need to load the pre-6.0 before loading the 6.0 one.
gmileka
|
|
|
|
|
Is it only for VS2005 MANIFESTDEPENDENCY
|
|
|
|
|
Hi,
I need to implement my own virtual driver which pretends to be a serial port. Other application would know better if it was a real port or not.
I know that there are programs that alreaddy do such a thing. Just Google to find them
but i need to write it myself.
Does anybody have a clue where to begin or have the correct search criteria to find it myself in google.
Anyhelp would be very appritiated.
codito ergo sum
|
|
|
|
|
To get you started, you will need to open the serial port with shared access (instead of exclusive) from both ends. The best way to do this is to write a serial port class (or take one of the many implementations on this site) and modify the OpenFile call to use the flag for shared access.
Your application (the code connecting to the serial port) and the simulator (the code pretending to be on the other end) will both use this class and you can handle your data accordingly.
An alternative (and easier) solution is to take a serial cable and connect it from 1 port on your machine to another one. Have the application and simulator each open 1 end of and behave normally (basically, creating a loopback using hardware).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|