|
Actually, Mike's method is better.
""It is impossible to rightly govern the world without God and the Bible." -- George Washington
FLUID UI Toolkit
|
|
|
|
|
What's wrong with my code? the first queried value works but the second one does not. What's the problem?
char Desktop[500];
char Programs[500];
char CurDirectory[500];
GetCurrentDirectory(1000, CurDirectory);
HKEY hKey;
DWORD dwBufLen1, dwBufLen2;
if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
{
RegQueryValueEx(hKey, "Desktop", NULL, NULL, (LPBYTE) Desktop, &dwBufLen1);
RegQueryValueEx(hKey, "Programs", NULL, NULL, (LPBYTE) Programs, &dwBufLen2);//doesn't work!
}
RegCloseKey(hKey);
-- Steve
|
|
|
|
|
|
I wonder if someone knows how i can get the same behaviour in a
CListCtrl or CTreeCtrl or any other control, that the searchresult ctrl
has in Kazaa.
I want a tree ctrl with multicolumn and the possibility to drag and drop
the columns.
And the expandable part, the +/- signs, should always be in the first column.
I almost found this in a ctrl on codeproject, but when the first column
was moved the +/- signs where moved to, not pretty.
It looks to me that Kazaa uses a CListCtrl with tree capabilities, but i'm not sure.
And if it is, how can i get it in my application?
I hope that someone knows what i'm talking about, and can help me.
|
|
|
|
|
Hi,
Usually when the computer is not connected to the net the interface in My Network Places appears Disconnected ("Network cable unplugged"). Is there a way to tweak the registry to bring up the interface without being connected to the net?
The reason I want to do this is because I have on my computer a win xp and linux. I run linux in VMWare. In linux I have a server and on windows the application that has to connect to the server.
Thanks
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
well, if you dont have another machine you can :
connect the cable to a sheap 10Mbp hub
or
you can insert a second network addapter in you machine and connect the two with a crossover cable
MSN:maxsnts@hotmail.com
|
|
|
|
|
Dear All
Could anyone please let me know how to print jpeg/bmp images in vc++?
When i do so, i get the image in the top left corner of the page,very small size.
I use the mm_loenglish mapping mode.
Alternatively can i use cximage for printing?but how do i do?
Would be great if u cud help me..
Thankyou very much.
|
|
|
|
|
You're problem is probably related to the page size / dpi of the printer. Printers typically have very large pixel counts - 300 dpi or more. You need to use GetDeviceCaps to get the vertical and horizontal pixel counts of the printer and scale your image accordingly.
|
|
|
|
|
I tried printing, but perhaps am making some mistake..
Could u please give me an example of how to do?Should i use it in onprepareprinting?Wud b great if u cud help me.
Thankyou.
|
|
|
|
|
Hi,
I've made a key accelerator for my program (I did it by using the resource view), and I want to 'attach' it to my windows. How can I make sure that the accelerator table is associated with the window?
Thanks
|
|
|
|
|
If you're using MFC, and the window in question is a frame window (derived from CFrameWnd ), it already has support for accelerators. To make the frame window load the accelerator table at the same time as the menu and other resources, give it the same resource ID as the menu and use LoadFrame to create the frame window.
If you want an alternate set of accelerators, use LoadAccelTable .
For a non-CFrameWnd window, you'll need to call LoadAccelerators to load the table, and insert a call to TranslateAccelerator in an override of PreTranslateMessage , returning TRUE if TranslateAccelerator does.
I don't know enough WTL to offer a suggestion.
If you're using the raw Win32 API, insert a call to TranslateAccelerator before your call to TranslateMessage in your message loop.
|
|
|
|
|
Hi,
I need to build some kind of app which, display a picture and after 10 seconds the next, etc......
To do that, I'll need some kind of timer conrol (like the Timer in .NET), is there something like that in MFC. If there is (I thinks there is), can somebody tell me how to use it?
Thanks
|
|
|
|
|
There is a sleep function that you can use. I just use it as a puase between command, so if i think you want to use it for the same purpose it would be ok. Maybe you can display the first pic, then sleep, then remove the first pic and display the second pic?
Sleep(time)
btw, time is in milliseconds.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
Sleep is a blocking call. No Windows messages can be processed while your thread is blocked. This means that the rest of the user interface will be very unresponsive.
If you don't need the timer to be very accurate, use SetTimer to have Windows send you a message when a timer expires.
|
|
|
|
|
|
CreateWaitableTimer() and SetWaitableTimer() can also be used
"Committee--a group of men who individually can do nothing but as a group decide that nothing can be done." - Fred Allen
|
|
|
|
|
Thanks you everybody; after reading your hints, I finally succeeded in building this part of the app!
;)
|
|
|
|
|
Hi all,
I am having trouble coding this and wanted to know how to check if a user enters a filename to open. Basically I want to check to make sure the file name is not all spaces and that it is not blank. I am not using CFileDialog right now, just have a editbox and a browse button that i got from a CP article.
Does anyone have code out there that does this? Can someone lead me in the right direction?
Thanks for all your help .
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
You can get at the string in the edit box with
CString FileName;
MyEditCOntrol.GetWindowText(&FileName);
You can then perform all of the validation on FileName.
To verify the edit box wasn't blank:
if(!FileName.Getlength())
//handle error here - zero length filename
To verify that no illegal filename characters were entered:
CString InvalidFilenameChars = ""; // put all invalid filename chars in this string
if(FileName.FindOneOf(InvalidFilenameChars) != -1)
//handle error here - filename contains invalid character
There may be a pre-built MFC way of handling all of this.........
|
|
|
|
|
:(hello
I need the source code in c++, for information extraction from html tables , and to generate with those data a XML document.
Please help me
Marco Javier Suarez Baron
|
|
|
|
|
One way is to use the MSHTML control and iterate the HTML Elements. Have a look at the articles here on using the HTML control and on MSDN.
Another option is HTMLTree http://homepage.mac.com/pauljlucas/software/html_tree/[^] however this is GPL, which may be a problem for you.
And finally Google search: HTML parser.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi,
I am in need of a variable that can hold a type (variable-type ex: int or double) and not a value of the specific type, just the type. Something that works like this:
VARTYPE Type;
Type = int;
switch (Type) {
case short:
break;
case int:
break;
case float:
break;
case double:
break;
} I know I can simply declare a bunch of constant numbers, who each represents a variable type. But that would be very non-optimal if there already exists an easier way. Could I use templates to achieve this or the use of preprocessors/macros? Just to be clear, I am looking for a variable that only contains a type and not a value.
Any help or tips are most appreciated.
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
almost:
switch(sizeof(type))
{
case sizeof(short): //need pre-defined
break;
includeh10
|
|
|
|
|
|