|
BoudewijnEctor wrote:
file: wincore.cpp
line: 4184
Strange as wincore.cpp does not have that many lines. Are you using VS6 or VS.NET?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I was also little bit confused!!!
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi,
I've got a listBox in a program, and an array of instances of an own class. This class has a property called ID, and name. Both can be accessed by using get_ID(), and get_name(). The user must be able to select an instance in the listbox by selcting its name and clicking a button.
This works, I use getCurSel, as long as I know what position each instance has in the list. But other people will need to add their own instances, and they will have to change all the ID's etc.
Is there a way to determine the text selected in a list box, instead of the position of the selection, so I will know exactly which instance is selected?
Thanks,
|
|
|
|
|
The way that I use is when I add a string to the list box, I also setup a pointer to the custom data, in your case, your own class. I usually do this with:
m_ListBox.SetItemDataPtr (m_ListBox.AddString (item->name), (void *)item);
You can then get the item data for the current selection like so:
my_class *item = (my_class *)m_ListBox.GetItemDataPtr (m_ListBox.GetCurSel ());
Does this help?
www.originalsinsoftware.com
|
|
|
|
|
You can use the CListBox::GetText method. GetText accepts the position and LPSTR as input, and you can pass the selected item position, and get the corresponding text.
pListBox->GetText( position, str.GetBuffer(MAX_LENGTH) );
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Is DirectX available to .NET framework? If not, is there any plan to make it available yet?
norm
|
|
|
|
|
Yes it is available... rather I programmed some programs in C#... You can download DirectX SDK from Microsoft.com
DirectX 9.0 Software Development Kit (SDK) for C#
http://download.microsoft.com/download/9/9/3/993dbaf4-3327-4f77-9bcb-9b6a6235170b/dx90_sdkcs.exe
mE
---------------------
A gasp of breath,
A sudden death:
The tale begun.
A rustled page
Passes an age:
The tale is done.
|
|
|
|
|
hey, that's very nice to know. Would you recommend a book? Or is the documentation sufficient?
norm
|
|
|
|
|
Hi
Can someone know a library wich is used to convert hexadecimal numbers to integers (I know how to do this, but I don't have time to wirte it myself). I just need an open-source function.
Thanks
|
|
|
|
|
BoudewijnEctor wrote:
convert hexadecimal numbers to integers
I think you might mean hexadecimal strings to a number.
The C++ library function, strtol() will do the job for you.
Or _tcstol() for the UNICODE compatible function.
long wcstol( const wchar_t *nptr, wchar_t **endptr, int base );
You just need to specify the base, in your case this would be 16.
I Dream of Absolute Zero
|
|
|
|
|
the question is kinda bad!
what do u need the conversion for?
hexadecimal to (int)string or what?
Don't try it, just do it!
|
|
|
|
|
Hi currently i use MSComm32.ocx control i just try to pass data into comm port ,i open port and send data by using
mptr->PutOutput("text"); simple text all fine not any error
arised.But when i try to pass binary data this way
byte bt[] = {1,2,3};
VARIANT vt;
vt.vt = VT_BYREF | VT_UI1;
vt.pbVal = bt;
mptr->PutOutput(vt);
Run time error hr = -2146827908 (Unknown error)!!!
I guess this trouble arised because of i unproperly created vt variable.
And by the way how i can properly create any pointers in variant type??? I think
first step is create array with neccesary values
byte bt[] = {1,2,3};
,second step copy this array to variant union
vt.pbVal = bt;
and third step defint through vt member of VARIANT this type
vt.vt = VT_BYREF | VT_UI1;
Its enought???
How compiler recognized how much ellements on array into passed VARIANT structure???This only pointers and one cant do it i thought???
Sorry for bad Eanglish.
|
|
|
|
|
Guys,
I've created a dockable tool bar. By default on the top of dockable tool-bar, there is a caption bar with close button. I like to remove this caption bar and close button from my tool bar. How can i do so
|
|
|
|
|
Hi
I am tryin to load a TLB file in my project. It is physically present on the disk and is included in INCLUDES and LIBRARY FILES variables of environment. In simple words all is good but compiler is generating following error...
fatal error C1084: Cannot read type library file: 'QTSLimits.tlb': Error loading type library/DLL.
But when I remove that TLB file, error becomes obvious...
fatal error C1083: Cannot open type library file: 'QTSLimits.tlb': No such file or directory
I thought that TLB file is corrupt, but I have compiled it again and againnnn... ANY SOLUTION?
I am tryin to compile VC++5/6 Code on VC .NET
thanks in advance!
mE
---------------------
A gasp of breath,
A sudden death:
The tale begun.
A rustled page
Passes an age:
The tale is done.
|
|
|
|
|
How are you trying to include the type library?
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
have made a .H file...
<br />
#ifndef QIMPQDLTYPES_H<br />
#define QIMPQDLTYPES_H<br />
<br />
#import "QDLTypes.tlb" no_namespace, \ named_guids<br />
#endif // QIMPQDLTYPES_H<br />
and include this .H file in required files... like stdafx.h
help me please... (right now me is practically like this...)
---------------------
A gasp of breath,
A sudden death:
The tale begun.
A rustled page
Passes an age:
The tale is done.
|
|
|
|
|
Can you view the Typelibrary through OleView.exe?
This will help to determine whether the type library is valid.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
yup.... all info is there :S
please don think I am wasting you time coz me is about to die right now :S
---------------------
A gasp of breath,
A sudden death:
The tale begun.
A rustled page
Passes an age:
The tale is done.
|
|
|
|
|
Dear All,
I am developing an application using MFC VC++ Version 6.0 for Windows 2000.
I have made my application run as a service. The application starts with an icon in the System tray. On double clicking the icon the application starts (ie. dialog boxes are displayed, some background operations are performed, etc..)
The application works very fine when i restrat the system i.e. the system tray icon appears and it performs the apporpriate functions . But when i loggoff the system and then loggin, the tray icon is freezed!!!
The tray icon then doesnot responds to the mouse events (double click , single click or right click)
I know that during loggoff the service keeps on running. And the application is performing its background operations also during loggoff, but the tray icon stops responding.
Do I need to refresh the tray icon ???? Or any alternate solution to above problem
Please comment!
Rohit
|
|
|
|
|
|
|
There can be several problems, but the most likely is that you dont get the notification about the tray creation. Following is from MSDN:
Taskbar Creation Notification
With Internet Explorer 4.0 and later, the Shell notifies applications that the taskbar has been created. When the taskbar is created, it registers a message with the TaskbarCreated string and then broadcasts this message to all top-level windows. When your taskbar application receives this message, it should assume that any taskbar icons it added have been removed and add them again. This feature generally applies only to services that are already running when the Shell begins execution. The following example shows a very simplified method for handling this case.
So you will need to do this and then handle that message
m_nTaskbarCreatedMsg = ::RegisterWindowMessage( "TaskbarCreated" );
And take a look at Chris Maunder excellent class
http://www.codeproject.com/shell/systemtray.asp[^]
Magnus
|
|
|
|
|
I dont think the problem is with getting the notification from tray.
The application works very fine when i restrat the system i.e. the system tray icon appears and it performs the apporpriate functions . But when i loggoff the system and then loggin, the tray icon is freezed!!!
On double clicking the icon the application starts
This means he got the notification atleast once.
Anyway looking at that article can provide him a hint.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Dear Jagadessh VN,
When i log off and login the
1) Tray icon appears
2) The background processsing starts
BUT THE SYSTEM TRAY ICON DOESNOT RESPONDS TO MOUSE CLICK EVENTS.
i.e. when i double click or move mouse over the icon, the icon has no response ( i traced my application and it shows no response)
So what may be the problem ??
Thanks .
Rohit
|
|
|
|
|
Hello
I would like to auto run my Floopy Disk which insert in Drive.
How can Trick the win98se/Win2k/winXP?
Please anybody Help me??
I'm Beginner of MFC and Visual C++.
|
|
|
|