|
Calder wrote:
I gotta be honest, I've just beginning to use the database classes, so I don't really know where to start!
If you are already familar with MFC, the code snippet, along with the comment, I provided should get you well on your way. Is there any particular item that is overly confusing?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
DavidCrow wrote:
If you are already familar with MFC, the code snippet, along with the comment, I provided should get you well on your way. Is there any particular item that is overly confusing?
Actually... How do I populate my controls with the data from the database?
Thanks for the help! (Highly appriciated )
|
|
|
|
|
Using ClassWizard, create a control variable for each control on the dialog. For example, of you have an edit control with a variable called m_ebName , you can set its value with:
m_ebName.SetWindowText("This is some text");
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
DavidCrow wrote:
m_ebName.SetWindowText("This is some text");
I don't think that would set any text recieved from the database/recordset... Or?
|
|
|
|
|
Obviously not, nor was it intended to. It was merely an example of how to use the SetWindowText() method.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Ok... Makes sense... However, I have no idea how to get the data collected to the recordset.
Let's take an example, in the recordset class I have a variable called m_FAX (Type CString). How can I put that inte an edit box called m_Fax? Is there a way to use Foreign Class in the ClassWiz? If so, I need to set a Foreign Variable - should that be a pointer to the recordset or?
Thanks for having patience with me!
|
|
|
|
|
Calder wrote:
Let's take an example, in the recordset class I have a variable called m_FAX (Type CString). How can I put that inte an edit box called m_Fax?
Is m_Fax a control variable of type CEdit ? If so, then
m_Fax.SetWindowText(set.m_FAX); will work.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Thanks! That works! However, I get a strange problem - when I started the app the first time, it all worked great.
However, when I closed the app it didn't dissapear from the Processes view in the taskmanager. If I stop the process it won't run again... I tried restarting the computer, but that doesn't help either.
Does anybody have a clue? I don't...
BTW, when I double click to start the program (or CTRL+F5 in VisualC++) it appears in the Processes view, and in MySQL Admin as an open thread. But the dialog never shows on the screen!
|
|
|
|
|
What does the OnInitDialog() method look like?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
II need to write code that will read a bitmap from a Url that is using a pluggable protocol (i.e. XXX://path to file) and not http. This all needs to be done from within code. The user has no input as to were the file is located. I am new at trying to read files in this manner. Thanks in advance for any help given.
chuckie
|
|
|
|
|
Post more information about the plugin. For example, does it access the data via socket or COM?
Kuphryn
|
|
|
|
|
I am trying to create a mfc app that can access bitmaps to be placed in the tool from a url that is associated with a pluggable protocol. I have no idea where the machine is that the data is coming from. All I know is that I need to read the file given the url “xxx://images/test.bmp.” where xxx is the protocol. Hope this is clearer. Thanks for the response.
chuckie
|
|
|
|
|
ummmmm
a big switch statement for each protocol and the reqd internetopen command?
"there is no spoon" biz stuff about me
|
|
|
|
|
In debug mode this code works fine, however when i switch to release i get:
Application Error: The Instruction at 0x77fc9865 referenced memory at: 0x7c45732 The memory could not be read.
I have looked and found this is probably to do with array bounds, but i can't see anything wrong with the code below.
Help would be appreciated
If i just return s then everything works fine, however this would be returning a local variable and the compiler will flag the warning.
char * get_font_string(HFONT hFont, HWND hwnd)
{
char s[1000];
TEXTMETRIC tm;
char face_name[200];
HDC hdc = GetDC(hwnd);
SelectObject(hdc,hFont);
GetTextMetrics(hdc,&tm);
GetTextFace(hdc,200,face_name);
if (!stricmp(face_name,"FixedSys"))
strcpy(face_name,"System");
if (!strcmp(face_name,"System"))
{
strcpy(face_name,"FixedSys");
tm.tmWeight = FW_NORMAL;
}
sprintf(s,"%d %d %d %d %d %u %u %u %u %u %u %u %u %s",
tm.tmHeight,tm.tmAveCharWidth,0, 0, tm.tmWeight,
tm.tmItalic, tm.tmUnderlined, tm.tmStruckOut, tm.tmCharSet,
0,0,DEFAULT_QUALITY, tm.tmPitchAndFamily,
face_name);
ReleaseDC(hwnd,hdc);
pReturnVal = (char*) calloc(strlen(s)+1,sizeof(char));
strcpy(pReturnVal,s);
//return s
return pReturnVal;
}
later in code:
strcpy(font_string,get_font_string(f.hFont,f.hwnd));
free(pReturnVal);
|
|
|
|
|
crandall wrote:
sprintf(s, etc..
Should be using snprintf, really. What's in the etc bit?
crandall wrote:
strcpy(str,someFunc());
Ditto, but with strncpy.
It would be easier to diagnose if you posted the code fully - that is to say that you post the minimum code (make a test app) that reproduces your problem.
--
Ian Darling
"The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski
|
|
|
|
|
Hey everyone,
I have a weird error. I was compiling some code last night and everything was fine. I then shut my computer down and then tried to compile the code this morning and I got these error messages.
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/Stations.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
They go away if I start a new project and then copy and paste this code into the new project...I am really confused can anyone help me??
|
|
|
|
|
hi
i think this is because invalid source ID. that means u may have deleted some Resource(Dialog Controls) and Forget to remove those ID from ur source files(resource.h,ur project source file)
Cheers
JP
|
|
|
|
|
oops! Sounds like something I would do. Thanks for the help.
|
|
|
|
|
|
Thats perfect!!!!
Thanks Mike
|
|
|
|
|
Hi all
How can i get current system time in microseconds resultion?
thanks.
|
|
|
|
|
i would say that you can't get more than milliseconds.
|
|
|
|
|
Are U sure?
If so, Do you have any idea how the guys at "Rational" added the abitlity to show time in microsecs in Quantify?
thanks.
|
|
|
|
|
Have a look at this codeproject article that will answer your query:
Timing Article[^]
I Dream of Absolute Zero
|
|
|
|
|
I have been using a DOS C program for several years which obtains system time in 100 microsecond increments, though you could do better. It reads the internal timer, along with the tik time, to give improved resolution.
My version uses a floating point calculation, which precludes using the floating point emulator.
I'll email you the brief source code.
David Knoble
Tupelo, MS
|
|
|
|