|
I think you meant to say queue instead of stack
|
|
|
|
|
See here.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
AfxBeginThread()
windows platform: process is comprised of main thread (UI thread on client-side) and can spawn additional threads (UI and/or worker) typically single cpu can process one thread any given moment and in this example spawn a worker thread to process data
Kuphryn
|
|
|
|
|
Thanks everyone!
All the answers have been a great help!
now I've got a lot of reading ahead of me!
Kitty5
|
|
|
|
|
|
I do agree that ideally you should employ the techniques suggested above, using worker threads. But sometimes a person does not have the time (or experience) for this route to be feasable.
I often use the pump message technique (equivalent in VB as DoEvents()) to prevent the UI freezing and also allow the user to interrupt lengthy sessions.
Have a look at the FAQ[^], under section
4.3 I have a dialog that does some lengthy processing, and I need to have a Cancel button so the user can abort the processing. How do I get the Cancel button to work?
I Dream of Absolute Zero
|
|
|
|
|
RChin wrote: I often use the pump message technique (equivalent in VB as DoEvents()) to prevent the UI freezing and also allow the user to interrupt lengthy sessions.
While I can understand not wanting to create tons of threads all over the place, creating what amounts to message pumps all over the place is a much worse practice and should be avoided (even in VB).
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
|
|
|
|
|
With some tinkering, I got Group View working for a list view control in report mode (e.g. the letter-heading-separators in XP-Explorer-"My Computer")
However, LVM_SORTITEMSEX doesn't yield a result. The comparison callback function gets called alright, but there's no change in item order.
Google doesn't yield much. Any experiences / tips?
|
|
|
|
|
hi all
I am creating tool tip for a button by using following code.
void CreateMyTooltip(HWND hwnd)
{
HWND hwndTT;
TOOLINFO ti;
LPTSTR lptstr = (LPTSTR)"This is my button";
RECT rect;
hwndTT = CreateWindowEx(NULL,
TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_BALLOON |
TTS_ALWAYSTIP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
SetWindowPos(hwndTT,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE |
SWP_NOACTIVATE);
GetClientRect (hwnd, &rect);
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_SUBCLASS | TTF_TRANSPARENT;
ti.hwnd = hwnd;
ti.hinst = NULL;
ti.uId = IDC_BUTTON1; // To this button i am adding tooltip
ti.lpszText = lptstr;
ti.rect.left = rect.left;
ti.rect.top = rect.top;
ti.rect.right = rect.right;
ti.rect.bottom = rect.bottom;
SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&ti);
}
when i moved my mouse on the button, instead of tool tip message "This is my button" i am getting |||||||||||, rectangular boxes.
I am new to win32 api'
thanks for ur valuable suggestions
Manjunath S
GESL
Bangalore
|
|
|
|
|
You are trying to build a Unicode application, but the string you are passing is ANSI. You have two choices: 1) build an ANSI/MBCS app; or 2) change this code line
LPTSTR lptstr = (LPTSTR)"This is my button";
to
LPTSTR lptstr = (LPTSTR)_T("This is my button");
Best wishes,
Hans
|
|
|
|
|
I am building an application in which i want to show the back ground of selected cell in a different color say red. i have used onLeave and OnEnter events of the grid to achieve that. in the onleave event handler i change the background of old selected cel to white and in the onenter i change the bkcolor of cell to red.
so the bkcolor of cell left is changed to white as needed and the cell to which user is moving becomes red. but this cell bkground is not set if the first selection by the user is cell(0,0)
it works fine unless the first selection by the user is not
cell(0,0) if user select cell(0,0) as first selection then its color is not changed. but if the user selects some other cell then its color is changed and selecting now cell(0,0) also changes its bkcolor.
|
|
|
|
|
Hello Everyone,
This is my first attempt at doing anything with C++.
I'm trying to create a C++ DLL using Visual C++ 2005 Express. The idea is to be able to call the functions in this DLL from an access application.
After trawling for days, I now have a DLL that compiles and seems to work fine on the PC where it was developed.
When I put my application on a different PC, I get a runtime error 48 when trying to load the DLL.
The error text is 'File not Found' when searching for my DLL, but my investigation has show that this is actually a DLL loading error. After adding debugging code, I find that the LoadLibrary error is 0.
I have tried rebuilding the DLL, rewriting it and receive the same error '48' every time whenever I try to run the DLL functions on other machines, despite everything being fine on the dev box.
Does anyone have any ideas?
Should I be shipping more than just the DLL to other machines?
Thanks in advance.
G
|
|
|
|
|
Wheres your dll file(path) in current directory from your app or in windows directory
|
|
|
|
|
Where are you installing the DLL on the other machines? The DLL needs to be either in the same directory as the calling executable (Access in the case) or in the Windows path. Are you using a library in your DLL? (i.e. MFC) If so are you using static linking or dynamic linking? Any dynamically linked library needs its DLL to follow the same rules, in the same directory as the executable or in the windows path.
|
|
|
|
|
|
I am attempting to change some text in a .dat file used on a pda with EVC++4.
However when my application reads the file on the pda it appears that every character that has been written to the file has a Null character after it.
When this file is transfered from the pda to a pc via activesync and viewed on the pc in notepad it appears that the null values are not present.
I have tried using fgetc to read each character from the file and fread to read the file into a char array and both options show the Nulls after each char. Tried fgets but this will not read I believe due to the Nulls in the string.
I am able to change the required text but it appears to be damaging the file as when viewed on the pc after the change it appears that the null values are present, also the application that uses this file fails to read it.
Would anyone know please why there would be null values after each character. Could the characters have been written originally as wide characters. If so could you help with a bit of sample code for the easiest way to read and write wide character data from and to a file.
Thanks
steve
|
|
|
|
|
the file is written in unicode. in unicode, each "character" is actually coded on 2 single bytes, so mainly, if it contains common occidental characters, their char code is within 0 to 255, which causes the 2nd byte to be 0.
|
|
|
|
|
It sounds like the file is written using the 16-bit character set (UNICODE). Use the wide versions of read functions and objects (wstring, wifstream, etc).
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
|
|
|
|
|
sdt24 wrote: However when my application reads the file on the pda it appears that every character that has been written to the file has a Null character after it.
fgetwc
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hello,
I have imported a VC6 project into Visual Studio 2005 and have a question. When looking at the dialogs in the dialog editor pane, they look fine--with the current style of buttons and such. But, when I execute the app, the buttons are rendering the older Windows style instead of the current version.
I created a new app just to see if I could duplicate the problem and i could not. This seems to have something to do with the import.
Does the import/conversion process not update the rendering to the latest styles?
Thanks!
|
|
|
|
|
|
ctroyp wrote: Does the import/conversion process not update the rendering to the latest styles?
if you need XP style you have to include manifest file in your program!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
So basically, if I do not have a manifest for it I need to create one?
Thanks for the reply...
|
|
|
|
|
ctroyp wrote: basically, if I do not have a manifest for it I need to create one?
yes you have to create one... see the link provided by Sarath
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I've looked through articles and in the forums but wasn't able to find what I needed. I'm trying to find a way to control the minimum size of the main/parent window so the user can't make it too small for the toolbar. I know there is a way to do it but for the live of me I can't find where to put the code. I created my initial code using MS Visual Studio MFC wizard so I have the standard classes. Any help would be appreciated.
Thanks,
Bubba
Wishin'I was fishin'.
|
|
|
|