|
Hello everyone out in the C++ Forum...just a quick note to inform everyone of today's release of Ultimate Grid 5.0 for MFC...lots of great new features are included, so you might want to check it out.
Ultimate
Grid 5.0 for MFC
Thanks a lot
Ed Worsfold
Dundas Software
|
|
|
|
|
I'm already an expert on how to make it crash. That's not what I'm after. I want to be able to temporarily lock up the main thread from another thread. I tried EnableWindow(FALSE) but the script re-enables it. I also tried CFrameWnd::SuspendThread() but that didn't do anything.
Cathy
|
|
|
|
|
Can you give more details on what you're trying to achieve Cathy? I'm a little unclear what you mean by "but the script re-enables it".
Usually freezing the UI thread is a bad idea because then the UI won't paint etc. etc...
I'm presuming you're doing some non-reentrant activity in a worker thread, and you need to stop commands whilst it's busy.
However, if EnableWindow() isn't cutting the mustard for you and you just need to prevent menu/toolbar activity, selectively trapping CN_COMMAND messages in an OnCmdMsg() override in the mainframe might achieve what you need. Remember to let CN_UPDATE_COMMAND_UI calls through though or your toolbars etc. won't update properly.
Good luck
Andy Metcalfe - Sonardyne International Ltd
Trouble with resource IDs? Try the Resource ID Organiser Add-In for Visual C++ 5.0/6.0
"I'm just another 'S' bend in the internet. A ton of stuff goes through my system, and some of the hairer, stickier and lumpier stuff sticks."
- Chris Maunder (I just couldn't let that one past )
|
|
|
|
|
Andy Metcalfe wrote:
Can you give more details on what you're trying to achieve Cathy? I'm a little unclear what you mean by "but the script re-enables it".
The other thread is trying to determine if they have a valid license. I don't want them to be able to use the program for a certian period during the validation. Our program is a COM server. If I disable the main window, the scripting engine reinables it.
Andy Metcalfe wrote:
However, if EnableWindow() isn't cutting the mustard for you and you just need to prevent menu/toolbar activity, selectively trapping CN_COMMAND messages in an OnCmdMsg() override in the mainframe might achieve what you need. Remember to let CN_UPDATE_COMMAND_UI calls through though or your toolbars etc. won't update properly.
Thank you. I will try that.
Cathy
|
|
|
|
|
Try using a mutex/WaitForSingleObject to pause your main thread. Then from the thread that verifies that they have a valid license, close the mutex, thus allowing your main thread to continue.
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Unless I'm missing something that will still prevent the UI from painting during the checking process.
Good idea in all other respects though!
Andy Metcalfe - Sonardyne International Ltd
Trouble with resource IDs? Try the Resource ID Organiser Add-In for Visual C++ 5.0/6.0
"I'm just another 'S' bend in the internet. A ton of stuff goes through my system, and some of the hairer, stickier and lumpier stuff sticks."
- Chris Maunder (I just couldn't let that one past )
|
|
|
|
|
Good luck Cathy. OnCmdMsg() is a useful (and damn scary at times) thing to mess with.
If you get stuck, shout and I'll post some examples.
Andy Metcalfe - Sonardyne International Ltd
Trouble with resource IDs? Try the Resource ID Organiser Add-In for Visual C++ 5.0/6.0
"I'm just another 'S' bend in the internet. A ton of stuff goes through my system, and some of the hairer, stickier and lumpier stuff sticks."
- Chris Maunder (I just couldn't let that one past )
|
|
|
|
|
hi
1) how can i get the names of the columns in a table without creating a CRecordset. I get the tables form the MSysObjects table. Maybe there is an other way to get the tables?????
I work with a Access databases, SQL and use the ODBC drivers.
2) is there a way to change the rights (read, write..) in C++ without using Access. Maybe through the ODBC driver????????????
please help!!!!!!!!!!!!!
Thx
|
|
|
|
|
hi,
anyone know how transfer datas from the Main Dialog to a TabPage?
|
|
|
|
|
you can do a GetItemDlg(IDC_OBJECT) to retrieve a pointer on the data structure. You have to cast the value like (CEdit *) GetItemDlg (IDC_EDIT);
|
|
|
|
|
I'm having a strange problem that I'm hoping someone can shed some light on.
In my COM server (.exe) i invoke the CString method Format. The problem is execution goes to the wrong override! Then it blows up.
Here is the initial command:
[ccode]
strDiag.Format(("iTotalUnused * 100) / g_ThreadsArray.GetSize() = %d",iTotalUnused * 100) / g_ThreadsArray.GetSize());
[/ccode]
When this executes I trace it into:
[ccode]
void AFX_CDECL CString::Format(UINT nFormatID, ...){ CString strFormat; VERIFY(strFormat.LoadString(nFormatID) != 0); va_list argList; va_start(argList, nFormatID); FormatV(strFormat, argList); va_end(argList);}
[/ccode]
instead of
[ccode]
// formatting (using FormatMessage style formatting)void AFX_CDECL CString::FormatMessage(LPCTSTR lpszFormat, ...){
[/ccode]
The actual blowup occurs in the LoadString function (which I don't want called in the first place0. It calls AfxGetResourceHandle which asserts afxCurrentResourceHandle is NULL.
I don't believe this is a bug in the CString class (i've used it too many times in this program.) I don't see anything wrong in my code, unless its environmental:
This control is windowless, it launches some number of worker threads and assigns tasks to them as requested. This code runs in one of the worker threads. The threads are created by instantiating a CWinThread derived object and invoiking its CreateThread method.
Thanks for the help,
Bill
|
|
|
|
|
The problem was caused by a typo,the parentheses are off.
Thanks for the help,
Bill
|
|
|
|
|
Seems like the evil comma operator strikes back
Well I guess all the problem reduces to having your first quotation mark displaced to the right of the second parenthesis, instead than to the left. As it stands, your expression evaluates as follows:
strDiag.Format(
(
"iTotalUnused * 100) / g_ThreadsArray.GetSize() = %d",
iTotalUnused * 100
) / g_ThreadsArray.GetSize()); ==> (operator , evaluates to its second argument)
strDiag.Format(
(
iTotalUnused * 100
) / g_ThreadsArray.GetSize()); ==>
strDiag.Format(iTotalUnused * 100 / g_ThreadsArray.GetSize()); and this of course selects the Format(UINT,...) overload.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have an byte array that contains 24 bit image. I would like to be able to scale it using StrechDIBits or something similar before I save the "compatible bitmap" to a bmp file. The problem is that if my screen is 16bit then my compatible DC is also 16 bits when I want it to be 24 and my image turns out distorted. Is there anyway to make a DC that is 24 bits even if the screen is at another BPP?
Please Help,
Clint Singer
PS. I thought I would try CreateDC but it seems that DEVMODE is only good for printers.
|
|
|
|
|
I don't know, but I *do* know if you create a DIBSection you can make it 24 bit and stretchblt it in a DC of any bpp. You could create one the same size and copy the bitmap data into it, then viola.
If you find a way to create a DC with a different bpp, I'd sure be interested to hear about it.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Do you have any examples as how to do this as I haven't been able to work well with a CreateDIBSection. I also assume one wouldn't use CreateCompatibleBitmap but rather define the Bitmap and all it's attributes to be 24bpp.
Thanks,
Clint
|
|
|
|
|
I would if www.wdj.com would come up. If you download the code for Sept 2000, I had an article there in which I create DIBSections and copy bitmaps onto them.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
How do you make a program that is split up into two parts? Like this
-----------------------------------------------
///////////|
///////////|
///////////|
///////////|
///////////|
///////////|
1//////////|2
-----------------------------------------------
How do I make that?
If I put one line of text in 1 that is there forever how can I make it open a .txt file in number 2?
Can someone help me?
http://pcverden.topcities.com
|
|
|
|
|
Is It Another Home Work???
Cheers....
Carlos Antollini.
|
|
|
|
|
Homework? No. I am making a program for Operation Flashpoint. It is a game that I am a really big fan of. Check this page if you doubt me
http://www.ofpeditingcenter.com or
http://pcverden.topcities.com
http://pcverden.topcities.com
|
|
|
|
|
I'm sorry, This happens a tipical question of a guy that wants that us make his homework.
Your question is serious. I was confused by your graphic...
You need to use Splits.
For this you need to use two views, look for splits into codeproject you will can find a couple of good articles talking about splits.
I'm Sorry again....
Best Regards...
Carlos Antollini.
|
|
|
|
|
Where can I find the split articles? I can't find them.
http://pcverden.topcities.com
|
|
|
|
|
Nevermind that last post, but I don't understand how to make them in Visual C++. Can anyone help? If you help can you make a step by step "tutorial"?
Also I am sorry for asking this. It is just that I am a complete rookie and my english isn't that great.
http://pcverden.topcities.com
|
|
|
|
|
You can find articles on Splitter Windows here. I think this is what you're looking for.
Also, I recommend buying a reference book if you're serious about programming. While not entirely necessary, books can be quite helpful. Click here for a list of useful reference books.
Good luck!
Jon Sagara
"Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
|
|
|
|
|