|
I've never encountered this. The pdb files (program database) contain debug informations for programs and libraries. By me is the mfc42.pdb file is installed in system directory WinNT\System32.
Sonork 100.15206;PavelK
|
|
|
|
|
Something's wrong if your debug version is linking with mfc42.dll. It should be using mfc42d.dll, so check your linker settings.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I'm working on a small database as an exercise to give to my friends and family. This is just to help me learn a little database programming and thought it would help me learn more to add extra functionality to the form.
I've tried and can't figure out how to color the form. I'd like to add a set of buttons (which I've done) that will allow the user to pick the color of the form background.
I'd appreciate any guidence on this.
Thanks
|
|
|
|
|
Hello,
You use the term "form", can you be more specific as to what kind of MFC Object you are referring to?
Maybe this might help:
COLORREF SetBkColor(<br />
HDC hdc,
COLORREF crColor
);
usage:
<br />
CPaintDC dc(this);
COLORREF crText;<br />
crText = RGB(128,128,255);<br />
dc.SetBkColor(crText);
Soliant | email
"The whole of science is nothing more than a refinement of everyday thinking." -Albert E.
|
|
|
|
|
I'm sorry. I should have been more specific.
I am building an ODBC database. The form naturally is the user interface where the fields are.
Thanks a lot for your time.
|
|
|
|
|
(Just a note for the future, when you say "form", C++ programmers probably won't understand what you mean. The term to use is "dialog" or "CFormView" if you're using that MFC class.)
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thank you Mike, I appreciate your guidence. I'm obviously real new here and I want to learn everything....naturally, there is always a little more to learn than I thought.
Have you got any thoughts on how I can make my CFormView different colors? Can I just make calls to OnPaint like in a CDialog class? I found an example for what I want to do but it's in a CDialogBox; would this be the same except of course for the names?
Thanks
Garry
|
|
|
|
|
OnEraseBkgnd() is the function to use. See the VC Forum FAQ (link at the top of the page), there's a FAQ about this topic. (I think it applies, I've not used CFormView much but I think the view behaves just like a dialog.)
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks a lot Mike, I appreciate your guidance a lot.
Garry
|
|
|
|
|
Whats the relation of database programming and coloring your form? Could you be more specific?
For let the user to choose color you can use CColorDialog .
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
There is no relationship between the two, I just thought that it would be good to explore other areas of programming while completing my database. The class I have derived my program from is CFormView. It's the form here that I would like to allow the user to customize.
Thanks again
|
|
|
|
|
You can override handler of WM_CTLCOLOR for your CFormView (or CDialog) derived class:
HBRUSH CMyFormView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
switch (nCtlColor) {<br />
<br />
case CTLCOLOR_STATIC:
pDC->SetBkColor(RGB(255,255,255));<br />
return (HBRUSH)(GetStockObject(WHITE_BRUSH));<br />
<br />
case CTLCOLOR_DLG:
return (HBRUSH)(GetStockObject(WHITE_BRUSH));<br />
}<br />
<br />
return hbr;<br />
}
The sample sets the form background and the backgroud for static controls to white. See MSDN on WM_CTLCOLOR to see, how to change colors for other standard controls.
For other colors, you need to create custom solid brush (using CreateSolidBrush), you need to solve the resource management for it.
Sonork 100.15206;PavelK
|
|
|
|
|
Thanks a lot! This helps a lot!
Garry
|
|
|
|
|
Hi all,
For some reason I can not get SetItemText to populate my subitems.
m_lcHistory.InsertItem(iCount,bstrUrl);<br />
m_lcHistory.SetItemText(iCount,1,bstrTitle);<br />
m_lcHistory.SetItemText(iCount,2,(LPCTSTR)(csLastVisited));
I am using Report style, I insert 3 columns fine, then the InsertItem populates fine w/ bstrUrl, but the two subitems do not display on my ListCtrl. Any suggestions or references ?
Thanks in advance.
Soliant | email
"The whole of science is nothing more than a refinement of everyday thinking." -Albert E.
|
|
|
|
|
Soliant wrote:
m_lcHistory.InsertItem(iCount,bstrUrl);
m_lcHistory.SetItemText(iCount,1,bstrTitle);
m_lcHistory.SetItemText(iCount,2,(LPCTSTR)(csLastVisited));
change to:
int nItemIndex = m_lcHistory.InsertItem(iCount,bstrUrl);
m_lcHistory.SetItemText(nItemIndex,1,bstrTitle);
m_lcHistory.SetItemText(nItemIndex,2,(LPCTSTR)(csLastVisited));
Best Regards
|
|
|
|
|
Fixed it! Thanks a bunch, a second pair of eyes are invaluable.
Soliant | email
"The whole of science is nothing more than a refinement of everyday thinking." -Albert E.
|
|
|
|
|
I cant get the mainframe to respond to the WM_HSCROLL sent by the slider. I saw an article in which the slider is put into a separate toolbar, created by a new class. This class responds to the notification from the slider in it. However, I just want the slider in my standard toolbar and cant trap the WM_HSCROLL....
Please help!
Thanks,
ns
|
|
|
|
|
Hello,
I am developing an application using sockets where I need to send numerical data, in particular floats between the client/server. I tried using sprintf/CString to format the float as text which was not very reliable as the precision needed it quite high.
Is there a way to reliably convert (cast) a float to a 4 byte character array? Do you have any code snippets that can do this? Thanks.
Ted
|
|
|
|
|
A 4-byte char array can only hold 3 characters, which obviously isn't enough precision for a float. Can't you just send the raw data? sizeof(float) will tell you how many bytes to send/receive.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Mike,
How would I do that, like this? Here is the function:
INT SetDataToSend(LPCSTR lpDataToSend, UINT lenDataToSend);
void Test()
{
float x = 34.23231;
SetDataToSend((LPCTSTR) x, sizeof(x));
}
Ted
|
|
|
|
|
Does SetDataToSend() expect a C-style string? Or just an array of bytes? If it's the latter (which I think it is, since it has a length parameter) then lpDataToSend should really be declared a BYTE* since LPCTSTR means a null-terminated char array. You can then write:
void Test()
{
float x = 34.23231;
SetDataToSend ( (BYTE*) &x, sizeof(float) );
}
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
float f= 3.0; // 4 bytes IEEE floating point
BYTE *p= &f;
Be warned this only works on same platform client/server. For instance, if your client is on Windows while your server runs on Unix you'll have to reverse the 4 bytes top-to-bottom.
And I swallow a small raisin.
|
|
|
|
|
My class contains static const COLORREF m_icon[<font color = red>16</font>][<font color = red>16</font>] var.
How do I point it so I could use the pointer as: pIcon[<font color = red>1</font>][<font color = red>1</font>] (for e.g.)?
I've tried:
static const **pIcon = m_icon ; //Error
static const *pIcon = *m_icon ; //Not an error but doesn't point properly
static const *pIcon[] = m_icon ; //......
Any other ideas? I guess I kinda forget the fundamentals...
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
static const COLORREF (*pIcon)[16];
I think that'll do it. You need to give all array dimensions except the last so the compiler can do the pointer arithmetic correctly.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I am proficient at C++, but am just learning MFC and Visual Studio.NET
In School I a used was a simple text enditor and gcc, but I think it is important to try new approaches.
I prefer to create my classes by hand, but since I am learning how to use Visual Studio.NET I decided to try the IDE to create new classes and add functions and variables. However I keep running into problems.
Problems with Add Function
1)I cannot seem to create constructors.
-I have to create a function then manually remove the return type.
2)I cannot create constant functions.
-I have to create a function then manually add const to the declaration and deffinition.
3)I cannot use default parameters.
-I have to add the function then add the default parameters to the declaration.
4)Once added I cannot delete functions.
-I have to manually remove both declaration and definition.
5)I can only add one function at a time, then the dialog disappears.
- When adding multiple functions I have to select Add Functions over and over again.
Problems with Add Variables
1)Sometimes when I try to add a variable it appears briefly then vanishes.
-I try over and over and it doesn't work. But when I manually add the variable with the exact same access, name and type my program works fine. Then I delete the variable and try to add it using the IDE and again it adds then vanishes.
(btw I use Lvl 4 warnings and treat warnings as errors)
2) Once added I cannot delete variables.
- I have to manuall remove them from the .h and .cpp files.
3) I can only add one variable ata time, then the dialog disappears
- When adding multiple variables I have to select Add Variable over and over again.
I end up having to edit the .h and .cpp files so extensively that I might as well type the whole thing in.
My Questions
1) Am I doing something wrong or do the Add Function/Variable features just suck?
2) Should I just ignore add function and add varibale unless I am working with an MFC generated class? Or should I use them to with all my classes?
3) Does Borlands C++ IDE suffer from the same flaws?
|
|
|
|