|
do anyone know about structured storage. please explain. i need a basic tutorial for this.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Google has some.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, first off thnx for the help guys getting a variable passed to a thread..
it works.
but i need to get either a return and check the status of a variable in that thread at any given point of time. can you help me out..
|
|
|
|
|
The basic approach to this problem is to have a variable that is accessible to both the thread and your program, and then to use one of the thread synchronization primitives to 'protect' the variable from simultaneous access by the program and the thread.
Here's a crude example, using an int as the shared data and a critical section for the thread sync primitive:
static int SharedVariable = 0;
CCriticalSection SharedCS;
static UINT Thread(LPVOID parameter);
int main()
{
AfxBeginThread(Thread,NULL);
for (;;<nobr>) {
SharedCS.Lock();
int shared_variable = SharedVariable;
SharedCS.Unlock();
}
}
UINT Thread(LPVOID parameter)
{
SharedCS.Lock();
SharedVariable = 1;
SharedCS.Unlock();
SharedCS.Lock();
SharedVariable = 2;
SharedCS.Unlock();
return 0;
} Each time either the main program or the thread function need to access the shared variable, they lock the critical section before the access, and unlock it afterward. When locked, a critical section guarantees that only one thread may 'enter' the section at a time. In my example, the main program is only reading the value, using it to monitor the progress of the thread.
Software Zen: delete this;
|
|
|
|
|
hi,
I am new to VC++ i am getting error for all assert's in the code. The error is error C2065: '__MODULE__' : undeclared identifier. I included assert.h still i am getting this error. Can any one tell me why is this error and what should i do to remove this error.
Sunil Reddy
|
|
|
|
|
Install latest platform SDK. Refer this FAQ[^].
|
|
|
|
|
Hi
All
I want to change font of Dialog Box in VC++ 6.0 which used CPropertyPage class.I this case there are more that one page on Dialog Box so how to change font of each page.
Thanks and Regards
Atul
Atul M
|
|
|
|
|
You have asked this question on numerous occasions in last few months. And answer is same. Use CWnd::SetFont . You need to dig out some things to get things done.
|
|
|
|
|
Thanks for reply
Where this function should call
Thanks
Atul
A
|
|
|
|
|
One of those places would be in OnInitdialog of property pages.
|
|
|
|
|
Hi,
In my MFC application I have shortcut keys, Now I want to check if the message is allready on queue I don,t want to add it, I mean to say if I have press CTRL+z till this undo action is completed user shold not be able to do another undo meance CTRL+z message wil be discarded.
How can I do this?
Thanks,
Rushiraj
|
|
|
|
|
Have a look at GetQueueStatus() .
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
In your handler for the CTRL+Z, do something like this:
void MyClass::MyCtrlZHandler()
{
static bool in_progress = false;
if (!in_progress) {
in_progress = true;
in_progress = false;
}
} If a second CTRL+Z comes in while the first is being handled, it is simply ignored.
Software Zen: delete this;
|
|
|
|
|
When my app rx'es a message, it gets it in the form of a MSG struct. That MSG contains the HWND that is to receive the message (i.e. my wnd). Is there any way to find the main HWND of the process that sent the message?
|
|
|
|
|
No (to my knowledge).
What message do you use, and what do oyu need the sender for?
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers! We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP Linkify!|Fold With Us!
|
|
|
|
|
It's a registered message, sent between associated apps. I want the receiving app to be able to display (in a list) the name of the app that sent the msg. I could pass the sender's HWND in the wParam or lParam, but I'm extending an existing app that already uses W and L, so I'm plumb out of args and trying to cook up a workaround
|
|
|
|
|
You may want to look into a more flexible form of Interprocess Communication[^].
Using window messages is extremely limited (two pointer-sized params and you can't pass useful
pointers between processes), and it requires a window
There's no way to know what window sent a message because a message doesn't have to be sent by
a window.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
I have my executable, PDB file and Linker files , does any one know of a way I can get the source code back ?
|
|
|
|
|
stixoffire wrote: does any one know of a way I can get the source code back ?
Ummm... where did it go?
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
I have no idea - it is no longer here I copy my files every so often for BckUp and well I dont have it , It is a lot of code so extrapolating from my PDB etc.. is too much..Man U EL labor.
IS there any thing that will get me in touch with my Warm Fuzzy Code..?
|
|
|
|
|
Not that I know of, unfortunately. Maybe your backups?
Hey, I know Manuel Labor
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
I have a game here, and it has about 30 music files, as well as 20 or so data files, and another 30 images, there all in their folders all nice and neat.
But i was wondering if there was a quick and easy way to store the files another way. And at the moment, its perfectly possible for a user to just delete some files, making the game useless, or changing the files, making the game... wierd...
|
|
|
|
|
You could indeed store all those the files in a dll and extract them either as-needed or extract them all upon app startup to a temp dir then delete the temp dir on app exit.
The typical way to store data (eg: a file) in a dll is to put it in the dll's resource table.
|
|
|
|
|
Hello all,
I'm pretty new at C++, and I'm trying to write a console program to communicate with a microcontroller via RS232. I'm trying to use the CSerial class (http://www.codeproject.com/system/serial.asp) to control one of the COM serial ports on my computer.
To open the serial port, I can call:
serial.Open(_T("COM1")); , which works.
However, I would like to prompt the user to select a port, so I tried:
<br />
string port;<br />
...<br />
...<br />
serial.Open(_T(port));<br />
This does not work; I get an error:
main.cpp(24) : error C2065: 'Lport' : undeclared identifier
The prototype for serial.Open looks like this:
<br />
LONG CSerial::Open (LPCTSTR lpszDevice, DWORD dwInQueue, DWORD dwOutQueue, bool fOverlapped)<br />
It turns out that _T("some string") will append an L to the string, so "some string" becomes L"somestring". But if I put in the variable port, it becomes Lport, which doesn't exist. How can I get around this?
I am using Visual C++ express with Platform SDK R2.
Thanks,
Mike
|
|
|
|
|
Change it to:
serial.Open(port.c_str());
|
|
|
|