|
I have a Combo Box als Drop List from 1 to ...10 and a Control edit field.
I want to insert for each combo Box List a Number from Control Edit; just like to save Elements in Array.
For example: for 1 -----> 20.2
for 2------->7.7
for 3---->2.0
...
but if i return to 1 Index my element ist stored as 20.2 ans so ...
How can i do that??
Best Reguards!
|
|
|
|
|
Huh?
Can you rephrase what you are trying to do?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
i have a Combo box listed from 1 to 10, and if i insert a number in Edit control it will be refered to combo box index.
just like array a1-->3.5
a2-->7.5
...
a10-->32.5
a1...a10 index of Combo box
Edit control field changed.
Thanks
|
|
|
|
|
So, you mean your combobox opens initially with a list box containing numbers 1..10.
The user can then change (using the Edit field) e.g. the 1 into a 0.5, the 2 into a 1, the 3 into a 1.5 etc.
Is that what you want?
If yes, you probably need to implement a map from combobox-indices to the (number-)strings to display.
You then need to InsertString() the (number-)strings into the relevant place of the combobox.
But I must admit that I never did this myself. So my help may be limited
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Hi friends!
I need to use a dll whose VC++ project I don´t have. Because the names of the dll are "mangled" I should use the library in the "__declspec(dllimport) ..." way. But I don´t have the .lib file needed for it, how can i create this file from my .dll file?
I´ve been looking the "lib" command reference in msdn, but the exectution of this tool gives me nothing: no errors, no warnings, no output files.
Does anybody know another tool, or the correct parameters for the "lib" tool?
Thanks in advance.
"When I look into your eyes, there´s nothing there to see, nothing but my own mistakes staring back at me"
|
|
|
|
|
If you don't have the lib file, you can always use the LoadLibrary() and GetProcAddress() functions.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
can we create the auto-start NT service?
I mean the service that starts even when I don't login the system.
CreateService can do it?
Then how?
Thank you.
Thanks.
|
|
|
|
|
Hendy_So wrote:
CreateService can do it?
Yes, specify the "SERVICE_AUTO_START" flag when calling CreateService.
Or you can use the "Administrative Tools" to configure a service to be started automatically at boot time, just select "Services" and double click your service from a list. If you are using Windows NT 4.0, then you have to use control panel to do this.
My articles and software tools
|
|
|
|
|
you are right.thank you.
i supposed it couldn't work.because it can't be debuged and i have no idea whether it will start before login.
so you are chinese too?from your name and your signature,i guess.
从你的名字,和你的签名档来看,应该是吧。呵呵。
Greeting from China.
|
|
|
|
|
Hi,
I'm currently writing some code for the manipulation of *.wav data and i want to use my algorithms for mp3 files too. I need something that loads a mp3 file to wav like uncompressed data. Something like:
Function(char *cMP3FileName,void **DataBuffer,int *iBufLen,WAVHEADER *whHeader);
can anyone give me a hint?
greets,
Jason
|
|
|
|
|
i want to do a project on VoIp using TAPI After having some basic knowledge.
pls tell me from where i can take start.
Faizi
|
|
|
|
|
I want to add the following behaviour to CDateTimeCtrl:
show the embedded month calender control when the user double clicks on the editbox of the datetime control.
So double-clicking on the datetime control would give the same result as clicking on the drop-down button on the right.
Don't ask me why, this is actually a request by a customer.
how should I accomplish this behaviour?
Any help is appreciated.
|
|
|
|
|
I know this is a relatively irrelevant issue but it's been in my mind for long time: while in stardard C we use bool for the "true-or-false" value, in MFC we see BOOL instead, which is in fact a typedef of 32 bit int on win32 plateform(I think). Now my question is why.
Seeing that in contrast with bool , BOOL does:
1, Occupy more memory storage, four bytes instead of one, not that matters a lot, but after all one has always been smaller than four since the first day when the human being could count.
2, Have pseudo-ambiguous data type comparing to bool , I said "pseudo" because the ambiguity is not for the compiler, but for the programmers themselves. In common sense I would think void Func(BOOL bVal) and void Func(int nVal) are different functions but they are in fact the same, so doing such overloading would generate compiler error. However, void Func(bool bVal) and void Func(int nVal) are indeed different and can be overloaded each other. Which one makes more sense to us?
Perhaps BOOL was introduced due to the fact that C++ allows an integer value to be treated as a "true-or-false", so without BOOL , then if (65535 * 2) { ...; } would generate a "data truncate" warning since a one-byte bool could not hold value of "65535 * 2", thus they came up with such a new BOOL which is capable of holding larger values. Hehe, personally, I never exam a pointer using if (p) { ...; } , I always use if (p != NULL) { ...; } instead, which I think is a better practice.
Anyway, I just couldn't see the necessity of BOOL even though I've been using BOOL in MFC applications for years.
|
|
|
|
|
I believe that prior to the C++98 standard, which MFC pre-dates, there was no "standard" built-in boolean type in C++ so MS defined their own (as many did back then).
Im not sure when C got the built-in boolean type bool (if it does), probably in C99, otherwise C++98 should have had it pre-98.
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
Hi,
I'm not absolutely sure, but i think the 'bool' is not part of ansi C. This could be the reason why microsoft introduced the BOOL, and it makes perfect sense.
If my assuption is correct, then the question is: Why the hell didn't they define BOOL as char instead of int?
greets,
Jason
|
|
|
|
|
The original Win16 API defined a bunch of data types for use in the API. Things like WORD , HWND , BOOL , LPARAM , etc., etc. date back to the 16-bit Windows days. This creates a type system that can be somewhat independent of the underlying hardware and operating system platform. This worked with some - though not complete - success when migrating code from Win16 to Win32 and from Win32 to Win64 (my understanding only, I have no direct Win64 experience).
Back in the Win16 days, the bool type was not part of the C or C++ language standards. It wasn't introduced until Visual C++ V5.0. So BOOL was defined in terms of types supported by the compilers of the day.
The definition has probably remained to ensure backward compatibility with both code and data.
Brad
|
|
|
|
|
=[ Abin ]= wrote:
In common sense I would think void Func(BOOL bVal) and void Func(int nVal) are different functions but they are in fact the same, so doing such overloading would generate compiler error. However, void Func(bool bVal) and void Func(int nVal) are indeed different and can be overloaded each other.
I have ran into this several times and had to use bool.
John
|
|
|
|
|
I too am annoyed by two versions of bool. What’s worse is if you use bool the compiler tells you about a performance issue. And with today’s processors I am not sure which one is really faster. Memory is slow compared to cpu cycles (disk is several orders of magnitude slower) so avoiding additional code bloat may be faster than executing a few extra cycles of cpu time... As others have pointed out BOOL is part of windows and not just MFC.
John
|
|
|
|
|
=[ Abin ]= wrote:
Anyway, I just couldn't see the necessity of BOOL even though I've been using BOOL in MFC applications for years.
I think it is just matter of who comes first and backward compatibility. For example, you cannot use type bool in a com interface (I think).
My articles and software tools
|
|
|
|
|
=[ Abin ]= wrote:
in stardard C we use bool for the "true-or-false" value
Before I started C++ programming in the mid 90's, c did not have a bool type.
One of the first things I did in every program was typedef bool or #define TRUE=1 FALSE=0
|
|
|
|
|
class A
{
public:
A();
~A();
};
======================
class B : public A
{
public:
B();
~B();
void RunOuterLoop();
};
=======================
int main()
{
A a;
B b;
b.RunOuterLoop();
return 0;
}
void B::RunOuterLoop()
{
etc.
}
The compiler returned a "LNK2001: unresolved external symbol" error message for both 'ctor' and 'dtor' of "B" even though both are defined. (Because of those two errors, it also returned one for "b.RunOuterLoop()", which is understandable.)
I have been staring at this for so long, I know I'm suffering from tunnel vision.
Thanks for any help.
William
Fortes in fide et opere!
|
|
|
|
|
You haven't defined any dtor or ctor for A or B, you've only declared them.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I didn't show them, but I did define all the 'ctors' and 'dtors'. (I believe I said that in my statement.)
A::A()
{
}
A::~A() { }
======================
B::B()
{
}
B::~B() { }
I didn't want to use up more space with my question than I had to, which is why I didn't show them.
William
Fortes in fide et opere!
|
|
|
|
|
Also, all methods in both classes A and B are private.
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
Thanks for replying.
That was totally an omission on my side in how I presented the sample. Everything in both classes are public.
I regret the oversight and will correct the sample, but the original errors still stand.
(I cannot believe some of these dumb oversights I still commit, and what's even more humiliating, is that I do it for the whole world to see!!)
Accept my word that EVERYTHING in both classes are public.
William
Fortes in fide et opere!
|
|
|
|