|
ok the includes are:
stdio.h
iostream.h
conio.h
stdlib.h
time.h
(yes there was one include too many :p)
kuni
|
|
|
|
|
ok the includes are:
stdio.h
iostream.h
conio.h
stdlib.h
time.h
(yes there was one include too many :p)
kuni
|
|
|
|
|
if (a=5)
Shouldn't that be if (a==5) ?
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
no i tried that before, it gives something even more odd, v becomes negative....
kuni
|
|
|
|
|
Perhaps you should initialize v variable at the start of the program
int v = 0;
Miroslav Rajcic
http://www.spacetide.com
|
|
|
|
|
lol i just figured that out thx anyways
|
|
|
|
|
Also, you never initialize v to be 0 -- probably explains why v is always 75536.
|
|
|
|
|
|
Can someone give me some tips on programming the systems control panels in code. Specifically the display control panel.
Thanks.
|
|
|
|
|
use the platform SDK version
|
|
|
|
|
I'm creating a program from which the user pick an item from a dropdown combo box then depend on what it is, display a short description in a text edit field, how can this be done? I'm pretty familar with the variables and classes and stuff, just need a way to do this... Please help.
|
|
|
|
|
You need to use the CCombobox::GetItemData() method.
But you first need to add the strings in the ComboBox and Set the Itemdata of each string. For this you have the CComboBox::SetItemData.
When the user pick in the combox you can get the ItemData and with this value you can search for a associated string with that value.
Good Luck!!!!
Carlos Antollini.
|
|
|
|
|
I'm trying to use the function AVISave, which takes as a parameter a callback function:
AVISAVECALLBACK lpfnCallback
with the prototype:
LONG PASCAL SaveCallback(int nPercent)
When it comes to passing a function to another function, we leave the realm of any C++ that I understand. How do I call AVISave? And, where does the "Pascal" come from?
thanks,
Jake
|
|
|
|
|
I don't know the prototype for AVISave, but this is the general idea:
LONG PASCAL SaveCallback(int nPercent)
{
UpdateProgress(nPercent);
}
void SaveAVIFile()
{
AVISave(SaveCallback, );
}
So really, in essence, you just treat the function as a variable.
Hope that helps,
> Andrew.
|
|
|
|
|
This is what my code looks like, where AVISave takes a callback function as 3rd arg:
long PASCAL CBadClass::SaveCallback(int percent)
{
return AVIERR_OK;
}
...
bool CBadClass::Foo()
{
AVISave(...,SaveCallback, ...);
}
This gives me the compilation error:
error C2664: 'AVISaveA' : cannot convert parameter 3 from
'long (int)' to 'int (__stdcall *)(int)'
None of the functions with this name in scope match the target type
needless to say, I've got no ideas here
thanks,
Jake
|
|
|
|
|
|
The ForumFAQ article has tons of good stuff, including telling me to make my callback function global or static, however I've tried it with each and still get the exact same error as before (see previous message). So, something else is killing me, I guess...any more ideas?
thanks,
Jake
|
|
|
|
|
Your member function doesn't have the required prototype. It's
long PASCAL CBadClass::SaveCallback(int percent) but AVISAVECALLBACK is defined as
typedef BOOL (FAR PASCAL * AVISAVECALLBACK)(int); Change the return type of your function to BOOL. And BTW, FAR is obsolete and can be ignored, and PASCAL has been replaced by CALLBACK in Win32.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
Well, for starters the parameter is a pointer to the callback function, so you might try &SaveCallback.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Hello,
In my app, I've got a function that performes a calculation on a string entered by the user in an editbox. If the text formatting (encrypted data) isnt correct the function fails with an unhandled exception error.
I've tried try{} and catch{}, but they don't seem to "Catch" the error. How can I trap the error (or any exception for that matter) so that I can handle this error gracefully.
Is there any way to find out exactly what type of CException (CFileException, etc) is being thrown?
Thanks,
Frank
|
|
|
|
|
It sounds to me either one of two things:
1. You haven't put your code in a try block:
try
{
}
catch (CMyException &e)
{
}
2. You're catching a different type than you threw. The best thing to do is to throw by value, catch by reference, as show below:
void MyFunc()
{
throw CMyException();
}
void main()
{
try
{
MyFunc();
}
catch (CMyExcetpion &e)
{
cout << "Error!";
}
}
Alternatively, you could use catch (...) which catches all exceptions.
> Andrew.
|
|
|
|
|
Thanks Andrew...
I'll give catch(...) a try.
Frank
|
|
|
|
|
I have a big project that has 5 ATL simple object. The first one is called as Header. This Header module will contain a collection of other objects. But cannot create these objects in the same application(though I can create them in another VB application). Can you help me?
Thanks a lot,
Cem
|
|
|
|
|
I have an MDI application using CView. I have a dialog that is setup as a CFormView. How can i show the CFormView as a child on command?
-Matt Newman
|
|
|
|
|
Why can't you just set it up as a dialog box ?
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|