|
Hi,
If u are targetting,
Win 98/Me/2000 , u can get what u want by trying
the WM_MENUCOMMAND which gives u a handle to the menu
and u can get the text.
Best of Luck
|
|
|
|
|
Hi
I've tried to create a toolbar with dropdown-style from my shell namespace exstension. I set all the common flags that I normally do. The dropdown arrow is displayed but I don't get any dropdown-notifications, only commands, no matter where I click or if I use BTNS_DROPDOWN or BTNS_WHOLEDROPDOWN.
Anyone with experience from this problem?
|
|
|
|
|
Hi, I have set up a CStringList containing lines of co-ordinate points of the form "20,30" for example, and would like to be able to process the CStringList lines into respective CPoint values so that I can use them as co-ordinates to map to the screen. I have managed to process the CStringList line to extract the string representation of "20" and convert it to CPoint.x and "30" to CPoint.y, but i am not convinced this is the best way to go about it. I would appreciate some help on this guys,
Cheers, Alan.
AEGC
|
|
|
|
|
Logically that is precisely what you need to do if you have a good reason to store them as strings in the first place. Why can't you build a vector ( OK, or a CArray ) of CPoints ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi friends,
i acutally have a little trouble with cursor on Win98SE. I have in the resource of my project 3 raw data item each one corresponding to an animated cursor.
With that:
HRSRC hrsc=FindResource(NULL,MAKEINTRESOURCE(IDR_NAV),"ANI");
DWORD dwSize=SizeofResource(AfxGetInstanceHandle(),hrsc);
HGLOBAL hg=LoadResource(AfxGetInstanceHandle(),hrsc);
LPBYTE pBytes=(LPBYTE)LockResource(hg);
i can get a pointer to my resource and with that :
HCURSOR m_Cur=(HCURSOR)CreateIconFromResource(pBytes,dwSize,FALSE,0x00030000)
result => m_Cur=NULL
but i must have to be able to create my cursor with CreateIconFromResource... but these cursor are 256 color. And it seems it is impossible to create 256 color cursors with the AIP function.
Have you any suggestion to help me ? ( i have to keep resource inside my .exe)
Thx all
|
|
|
|
|
Is There someone which can help me to kill a process by code (Visual C++) knowing the process name? Thanks
Nando
|
|
|
|
|
Hi,
Take a look at the following article.
http://codeguru.com/system/killer.html
Kumar
|
|
|
|
|
I'd like to add a colour to an already existing CPalette, so that I can then write on the corresponding bitmap with a new colour. Anyone know how please?
|
|
|
|
|
See MSDN for CPalette::SetPaletteEntries, and if necessary see CPalette::ResizePalette as well.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
|
Hi, all.
========
I have a function that creates threads.
How can I know when a thread is ended?
Like when a thread is ended a function will be called, or somthing like that.
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
From MSDN:
When a thread terminates, the thread object attains a signaled state, satisfying any threads that were waiting on the object.
Use WaitForSingleObject() to determine if the thread has signalled:
if (WaitForSingleObject( hYourThreadHandle, 0) == WAIT_OBJECT_0)
DoSomething(...);
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hi,
U can use the above mentioned method or u can use the
'GetExitCodeThread' to test,
With this method u dont need to hold up processing,
and if the thread is still active it will return
the exitcode as 'STILL_ACTIVE'.
Best of Luck.
Kumar
|
|
|
|
|
Dear Friends
Hi
Will you please anyone tell me how to maintain scroll bar if no. of line of document is unknown.
is it not possible that system itself maintain the scroll bar automatically.i am new to VC++ so please help me in getting the solution.
Thanks in advance
Bye
Binay
|
|
|
|
|
If you're using MFC, and derive your view from CScrollView, then you'll get scrollbars, but there really is no way your program will magically know how far to scroll if you don't. You'll need to count the lines, and factor in the number of lines visible in order to derive the scroll values you need.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Dear Christian
Hi
Thanks once again for ur suggesion.As you know i am doing modificaion by copying and paste method.So in my project it is not sure how many lines user has to copy.that is why i am facing problems.But i think there is no any other way for automatic adjustment of scrollbar without knowing the no. of lines.
Thanks for ur reply once again.
Bye
Binay
|
|
|
|
|
Hi guys, I need some help
I get a filename from an external source, and I must create a file on disk with that filename. The problem is that there is no garantee that the filename I have is a valid filename, i.e. it can have invalid characters such as \ / : * ? " < > |.
Is there a standard way of fixing invalid filenames (through a windows shell api maybe?). I know that I can do it manually, but I would prefer to use a standard method.
Thanks!
James
(2b || !2b)
|
|
|
|
|
You can't really "fix" a filename without applying human ai to it.
for example, say i typed this: c:\myfile.8nc
my big fingers hit the 8 key instead of the i key. You're never going to be able to fix errors like that: other problem areas are where user hits / instead of ., etc.
AFAIK no programs in windows will try to fix a bad name. what you should do is try to create the file anyway, but look for errors from the CreateFile() function. If there is an error, then report back to the user.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
This is in a server program, not a UI app, so no user interraction can take place.
Thanks anyway
James
(2b || !2b)
|
|
|
|
|
Is it just a filename we're dealing with, or an entire path *and* filename?
If it's just a filename, you can easily scan the string for the invalid characters. If it's a path and filename, you have to split it into it's component parts, check the components one at a time, and then (if you found invalid characters) reassemble the filename without the bad characters.
I guess you could use the Win32 or C++ api to do sanity checks (like trying to create the file on the drive and evaluating any error condition that might be indicated), but it's a lot simpler to just scan/fix the string programatically because then you don't take a chance on generating a message box on the server that nobody can see anyway.
char cMarker = '|';
CString sBadChars = "\\/:*?\"<>";
CString sMyFileName = "a/b:c,1<2>3.xvy";
int nLen = sMyFileName.GetLength();
char cCurr;
for (int i = 0; i < nLen; i++)
{
cCurr = sMyFileName.GetAt(i);
if (sBadChars.Find(cCurr) > -1)
{
replace it with our marker char
sMyFileName.Replace(i, cMarker);
}
}
sMyFileName.Remove(cMarker);
<pre>
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
Hi
Use MFC's 'CFile::Open' which will automatically
check for errors, and if there is an invalid file name
it will throw an expection and the
'CFileException::m_cause' will be 'CFileException::invalidFile'.
So u just need to go on creating the file and in case of
exception stop creating.
Best of Luck.
Kumar
|
|
|
|
|
a.x etc. are floats
float arg = (a.x - b.x / a.y - b.y);
this gives me an arg of -1,#IO while I want it to become 1
if I change the code to the following, which is of course the same thing:
float arg = (0.0f - 1.0f / 0.0f - 1.0f);
the compiler tells me:
error C2124: divide or mod by zero
when typing this message I solved it but still, this shouldn't matter. This is the line of code which works correct:
float arg = ((0.0f - 1.0f) / (0.0f - 1.0f));
is this a c++ bug? Do I have to put braces around all my variables?
WAVK
|
|
|
|
|
It's not a bug, division has higher priority than addition/subtraction. This is really basic math, it's not limited to C++.
|
|
|
|
|
When the compiler does the arithmetic, it completes the sums in operator precedence. different operators (*, / etc) are thus done in different orders, unless you use ()'s to change the order.
since the order is this (i think) .... * / + -
then your line:
float arg = (0.0f - 1.0f / 0.0f - 1.0f);
will do the divide operation first. Thus 1.0 / 0 is a divide by zero error.
it's good practise to always use parentheses to control the prescedence of your operations. suffiecient here would be:
float arg = (a.x - b.x) / (a.y - b.y);
Note that your original line,
float arg = (a.x - b.x / a.y - b.y);
since the ()'s were around the whole expression, they weren't doing anything at all.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I need to catch up some sleep it seems?! aaaaaaaaaaaaaaaaaaarg how could i be that stupid, of course I know that, aaaaaaaaaaaaaaaaaarg.... thanks for waking me up
WAVK
|
|
|
|