|
Cam, I really appreciate all your assistance. I hoipe to repay you someday somehow. I downloaded the file you attatched and after it downloaded I tried unzipping it and received the error message "file is multipart or corrupt. Thank you for the attempt.
|
|
|
|
|
drat...sorry about that. I'm uploading the corrected version of the file right now. It ought to be at the same exact location by the time you recieve this, so just follow the original link if you'd like to download it.
~Cam Desautels (BinaryUprising.com)
|
|
|
|
|
If you made the variables of type float, then you need to make sure that only numbers are being entered into the edit boxes. Sadly, if you click the option in the edit box properties to make the value a number, you will only get int's, the decimal point will also be supressed.
You really should consider posting some code when asking for help. I suspect if I saw the code I'd probably know what you were doing wrong.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Christian, Thanks an aweful lot for helping me. I REALLY appreciate it.
|
|
|
|
|
If you made the variables of type float, then you need to make sure that only numbers are being entered into the edit boxes. Sadly, if you click the option in the edit box properties to make the value a number, you will only get int's, the decimal point will also be supressed. However, if the values are ALL set to be floats, there is no char to float conversion happening at ALL, so I doubt you've got that bit right, or if you have, the problem is elsewhere and you should be posting the code where it crashes.
You really should consider posting some code when asking for help. I suspect if I saw the code I'd probably know what you were doing wrong.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
True, true, sorry about that...int math was simpler...
~Cam Desautels (BinaryUprising.com)
|
|
|
|
|
You might want to have a look at this little article. It is a set of classes built to take numeric input from edit boxes and it handles a lot of those messy details for you. There are facilities to use sliders also but you don't have to.
I hope this helps.
|
|
|
|
|
But it's so simple, really. And the point is to learn. Once he gets it down he'll be pumping these things out in no time, and wondering what was slowin' him down before.
~Cam Desautels (BinaryUprising.com)
|
|
|
|
|
You guys are awesome, Thanks for your help!!
|
|
|
|
|
|
Cam, I'm sorry I didn't say. Yes, I got it owkring. Thanks a lot for your help! It's impressive to see that there are people out there that seem to REALLY care. Your code and that srticle that Rich sent me to set me right. THANKS! By the way, GREAT web site!
|
|
|
|
|
Sorry about the typos, I'm pretty tired now.
|
|
|
|
|
Sorry about the typos, I'm really tired now. Good night
|
|
|
|
|
Ok, very cool, very cool...no problem about the help, I'm a struggling C++ programmer myself (yeah, but what the heck, I'm 17, it'll come...), and if I help others with what I can, maybe someone can help me when the time comes. Thanks a lot about my site, I have a lot of fun with webdev. Did you see there's a little text box on the right-hand side of the homepage where you can post comments (hint, hint). LOL, anyway, the best of luck to you, I'm glad I could help.
~Cam Desautels (BinaryUprising.com)
|
|
|
|
|
i have created a new project with a recordset.
with the toolbar that the wizard supplied i can navigate throught the records but i can not figure out where i can update controls on my dialog when navigating.
thank you for any help
|
|
|
|
|
Hi,
U have to use the Recordset to bind the dilaog controls to the
recordset fields.
U can do this by the RFX_ macros and attaching by using the DDX macros
by hand, that's a little tediuos, but
u can do automatically in the following manner.
1. When the Dialog is open in the Resource Window.
2. Select a control and open class Wizard(Ctrl+W)
3. Then depending on the control u selected and to the
field u want to display in the control
4. Select the control and go to the 'Members Variables' tab
5. Select the control and press 'Add Variable'
6. In the Member vaiable name --> Select the Recordset field u want
to associate.
Phew,
Thats all.
|
|
|
|
|
thank you could not be easier
|
|
|
|
|
can i cast a member func ptr to global func ptr
(without a compilation error...)?
typedef void (*Func)();
class Moo{
void Do();
void Cast_A_Func(){ m_fn = (Func)(void*)Do; } //Or something like that...
Func m_fn;
};
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
No, because member functions have 'this' as their first argument (although you don't write it that way). Your code will work only if Do() is static, since static methods have no this pointer.
--Mike--
http://home.inreach.com/mdunn/
"Not our fault we are intellectually superior to the rest of the office." -- Paul Watson in the Lounge, 12/12/2001
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Well, if you're in desperate need of treating a pointer to member function as a regular pointer to function, and you can afford changing the calling convention of your member function, then there is a tricky, heavily non-portable workaround: Consider the following class:
class A
{
public:
int __cdecl f(int a_){a=a_; return a+1;}
private:
int a;
}; From the point of view of the compiler, A::f is called like a regular function having a first hidden parameter that provides the this pointer. That is, the types PMEMBFUNCTION and PFUNCTION , defined as
typedef int (__cdecl A::* PMEMBFUNCTION)(int);
typedef int (__cdecl * PFUNCTION) (A*,int); are equivalent in the sense that the compiler generates the same code to execute calls for them. Alas, this kind of equivalence does not allow us to force a cast between the types. So the snippet of code
A a;
PMEMBFUNCTION pmf=A::f;
PFUNCTION pf=reinterpret_cast<PFUNCTION>(pmf); does not compile: from the compiler point of view, the types involved are wildly disimilar. Tricks like trying an intermediate cast to void * do not work either.
Not all hope is lost, nevertheless. We can use a last resort to force the casting. This struct
struct caster{
union{
PMEMBFUNCTION pmf;
PFUNCTION pf;
};
}; implicitly does the casting for us: the union allows us to store a PMEMBFUNCTION and retrieve a PFUNCTION . This kind of "casting" is even stronger than the allmighty reinterpret_cast !
So here's a complete program that shows how to call A::f as a regular function, providing the extra this parameter. I hope the technique is clear after this exposition.
#include <iostream>
using namespace std;
class A
{
public:
int __cdecl f(int a_){a=a_; return a+1;}
private:
int a;
};
typedef int (__cdecl A::* PMEMBFUNCTION)(int);
typedef int (__cdecl * PFUNCTION) (A*,int);
struct caster{
union{
PMEMBFUNCTION pmf;
PFUNCTION pf;
};
};
int main(void)
{
A a;
caster c; c.pmf=A::f;
PFUNCTION pf=c.pf;
cout<<pf(&a,666)<<endl;
return 0;
} One major drawback of this trick (apart from being scandalously non-portable) is that the member function has to be declared with the __cdecl calling convention. Why is this so? Well, if no calling convention is specified, the compiler uses the default __thiscall . In this calling convention, normal parameters are passed to the member function as in __cdecl , but the this pointer is stored in register ECX. You cannot simulate this behavior when calling a regular function, unless you use some assembly code.
Also, this definitely does not work with virtual member functions.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hello!
i have a problem with SendInput function...
i need to simulate the Ctrl+C... and after it i'm getting the text string from Clipboard...
but there is a delay between the SendInput is called and the keys are simulated... and when i'm getting the text from Clipboard, i'm getting the old Clipboard data...
what should i do?
maybe i need to use some delay function after SendInput?...
if you know any delay functions, please tell me...
|
|
|
|
|
Install a clipboard viewer, and you'll know exactly when the contents of the clipboard change. See my article ClipSpy in the clipboard section, which demonstrates a clipboard viewer.
--Mike--
http://home.inreach.com/mdunn/
"Not our fault we are intellectually superior to the rest of the office." -- Paul Watson in the Lounge, 12/12/2001
Sonork - 100.10414 AcidHelm
|
|
|
|
|
I have an SDI app where the CMainFrame is broken up with static CSplitterWnds. When I create the view (CKeypadView) with CreateView() it properly passes in the pointer to the CDocument.
m_splRightCol.CreateView( 2, 0, RUNTIME_CLASS(CKeypadView), CSize(0,0), pContext )
When I break when the OnUpdate() is called from the OnInitialUpdate() the pointer now reads NULL. Why?
------------------------------------------------
I am not discouraged because every wrong attempt discarded is another step forward
-- Thomas Edison --
|
|
|
|
|
Hello, the codegurus around the world.;)
OnInitUpdate() function is called a couple of times before acutally
its view is created (?) or is visiable.
So, you must add the validation code to check if some controls in OnInitUpdate() have their own HWND or CWnd (not NULL).
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
I removed the code that tries to access the CDocument from OnUpdate(), but even when I try to access the document later on (using GetDocument() ), it still doesn't have a pointer to the document. All other views still have a valid pointer.
Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope.
-- Daniel Burnham
|
|
|
|