|
Thanks Fred, got it up and running now..
|
|
|
|
|
Do you know how to change the background color of a CDateTimeCtrl control ?
Thanks.
Where there is a WISH, there is a WILL.
|
|
|
|
|
Have you tried CDateTimeCtrl::SetMonthCalColor ? It allows great flexibility on which colors you can change.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Silly me. I took a look at the help on CDateTimeCtrl but I did not see this method.
Thank you. That should do the job. I try it right away. Thanks.
Where there is a WISH, there is a WILL.
|
|
|
|
|
Too bad. This is not really what I needed. SetMonthCalColor() only applies to the calendar that pops up when you click on the combo box'x arrow.
What I want to change is the background color of the EditCtrl-like control of the CDateTimeCtrl.
Thanks anyways.
Where there is a WISH, there is a WILL.
|
|
|
|
|
Maybe (not sure) this color can be changed the same way the background color of other controls (CStatic s, CEdit s) is. Check §4.9 of Mike Dunn's C++ FAQ. Good luck!
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I built a dll with a simple function in it.
the question is:when i call the function using static linking,no error occur.
but when using dynamic linking,after the function execute complete,an error alway ocurred?
WHY?
the relative code is:
(1)with the dll project:
#include "math.h"
extern "C" __declspec(dllexport) double SquareRoot(double d)
{
CString strText;
if(d>=0.0)
{
strText.Format("%f",sqrt(d));
AfxMessageBox(strText);
return sqrt(d);
}
return 0.0;
}
(2)within the caller project:
*.h:
typedef double (WINAPI *TCSV2DVS)(double);
HINSTANCE m_hInstance;
TCSV2DVS FCSV2DVS;
*.cpp:
void CCallerDlg::OnButtonConvert()
{
m_hInstance = ::LoadLibrary("C:\\DLL\\CsvDvs\\Debug\\CsvDvs.dll");
if (m_hCsvDvs == NULL) {
AfxMessageBox("Load CsvDvs.dll error!");
}
FCSV2DVS = (TCSV2DVS)::GetProcAddress(m_hCsvDvs,"SquareRoot");
double ret = FCSV2DVS(9.0);
::FreeLibrary(m_hInstance);
}
Thanks advance.
(sorry for my poor english)
|
|
|
|
|
I guess the problem has to do with this two lines:
extern "C" __declspec(dllexport) double SquareRoot(double d) and
typedef double (WINAPI *TCSV2DVS)(double); Either include the WINAPI specifier in the first line or remove it from the second.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It does work!
Thanks a lot.
|
|
|
|
|
Is it possible to use 24bit BMP when creating a DirectDraw game?
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Well it depends on your graphics card, but yes DirectDraw will support 24bit graphics. Look at IDirectDraw4::SetDisplayMode
Michael
|
|
|
|
|
Hi,
Selection of an item in my tree control does not always work, how come??
What is funny is that the item(s) which can't be selected are always located from the fifth visible item to the 9th item. If I scroll the visible items, the ones which I couldn't select become selectable, and other become unselectable.
The unselectable items can however be selected by clicking on the left side of their icon... but clicking on the right side or onto the text won't work
Keyboard selection always work.
Does someone have a clue what is happening??
Thanks
|
|
|
|
|
Does it have this problem just on your computer?
Or on every box it's run on?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I found the problem... and I'm ashame!
There was another tree control hidden under the first one!
Thanks anyway
|
|
|
|
|
I am trying to use an ownerdraw combo box (the same happens with list boxes) WITHOUT the CBS_HASSTRINGS style set. I am wanting to store data (an int between 0 and 100), and because of the owner draw, I don't want to include a String to display. In all previous versions of windows I could call AddString((LPCTSTR) iMyVal), and because the control doesn't have CBS_HASSTRINGS, I could then get this value back through the item data.
I have a problem however on WinXP, with the common ctrl v6. It will not accept an item with a value of 0. I can understand that if I had the "CBS_HASSTRINGS" flag set, a pointer of NULL is to be avoided, but in this case it is quite valid.
Has anyone else encountered this problem? Does anyone know of a work around? I don't want to rewrite the code (it could take weeks!!) to work on 1 to 101 instead.
|
|
|
|
|
Hello,
I am trying to make a simple MDI (html browser). When I input the url and try to get the active MDI page to navigate to the specified url it crashes.. here is the simple line of code that is crashing my app.
((CHtmlView*)GetActiveView())->Navigate2(_T(strAddress),NULL,NULL);
I have tried MDIGetActive, GetActiveView and GetActiveDocument..
Any ideas?
Thanks,
Rob
|
|
|
|
|
MDIGetActive gets you the active MDI child-frame
Now you need to call GetActiveView on that
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I am new to MDI type apps.. Can you show me a short example?
Thanks,
Rob
|
|
|
|
|
Dear All:
I use MFC's Wizard to generate a MDI application with a Full-server support. It passed the link pretty good but when I F5, an Assert problem occurs! The message looks like this:
Debug Assertion Failed!
File: olelink.cpp
Line:291
This assert is invoked by following codes in InitInstance and after AddDocTemplate();
//Connect the COleTemplateServer to the documenttemplate.
//The COleTemplateServer creates new documents on behalf
//of requesting OLE containers by using information
//specified in the document template.
m_server.ConnectTemplate(clsid, pDocTemplate, FALSE);
// Register all OLE server factories as running.
// This enables the OLE libraries to create objects from
// other applications.
COleTemplateServer::RegisterAll();
The same code works on other people's machine pretty good, but some other people have the same problem.
Has anybody meet this problem before?
Thanks a lot.
|
|
|
|
|
How can I select the text in a CEdit control.
I have tried the SetSel(first_pos, last_pos) but the text don't be "blue".
SetSel() works fine to cut or paste... but i want the text to be marked whit the blue line, as when using mouse.
regards,
Ola
|
|
|
|
|
After the SetSel you need to do a SetFocus
m_pedit.SetSel(1,10);
m_pedit.SetFocus();
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
hmm...
I still can't get the text marked blue.
/Ola
|
|
|
|
|
Then what color are they coming in?
Or are you saying text is not even selected?
And does the cursor start blinking in the edit box?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Text in edit box is not visible selected.
Cursor starts blinking, and if I use m_editbox1.Cut(); text disappear.
If I write some, text in edit box are not replaced.
Code example:
void CMyClass::OnSetfocusBox1()
{
m_box1.SetSel(1,10);
m_box1.SetFocus();
// m_box1.Cut(); works, but text in box are never visable selected.
}
Ola
|
|
|
|
|
I am writing a EBCDIC conversion program but this is all new to me. Is there a function that allows you to take in more than a byte at a time and convert it, for example.
My second and third bytes (0x00 0x08) indicate the length of the record. Therefore I don't want to take them in one at a time I want both bytes and then convert them to give me a length.
Any tips on such a thing would be appreciated?
|
|
|
|