|
CString CGuid::ToString(bool withCurlies) const
{
#ifdef _UNICODE // ----- UNICODE -----------
LPCWSTR mask = withCurlies ? L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}" :
L"%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X";
#else
LPCSTR mask = withCurlies ? "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}" :
"%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X";
#endif
CString s;
s.Format(mask,
Data1, Data2, Data3, Data4[0], Data4[1],
Data4[2], Data4[3], Data4[4], Data4[5],Data4[6], Data4[7]);
return s;
}
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Hi, all:
I am trying to create some cursors with bigger than 32x32x256 color. Here is what I did:
I created a simple Dialog Based MFC appication and place a simple button (IDC_BUTTON1) on the dialog.
I created a 96X96x256 color cursor in the Resource Editor: IDC_CURSOR1 ( Deleted the 32x32XMono) .
In the Button1 click event handler, I have the following code:
<br />
void CCursorTestDlg::OnButton1() <br />
{<br />
::SetCursor(::LoadCursor( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDC_CURSOR1) ));<br />
<br />
}<br />
I also handle the WM_SETCURSOR event as
<br />
BOOL CCursorTestDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) <br />
{<br />
<br />
return TRUE;<br />
<br />
}<br />
After I clicked on the Button1, the cursor changed to the IDC_CURSOR1, but shrinked it to 32x32 size.
What do I do wrong, how can I keep it to my size in the Resource Editor?
Thanks in advance and your help is highly appreciated.
Dion
|
|
|
|
|
Have you tried using LoadImage() instead of LoadCursor()? IIRC LoadCursor only loads cursors of the default size for the system.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks very much. It works.
|
|
|
|
|
Thanks much.
The LoadImage() does give me the bigger size cursor. However, I still have a couple of problems:
1. I have a finger cursor with 256 colors. If I use Loadmage(), besides the finger, I see a shadow on the 96x96 square and it is not entirely transparent. If I use 16 color, the square disappears as normal window cursor but I lost all the pretty colors. Is there anywy to fix this?
2. In my application, I have to click on 3D objects. Before I made the changes ( I used LoadCursor() ), the cursor works fine. Now, If I click on a 3D object ( MouseDown) the cursor disappears until I move the mouse a little. It does not happen in the LoadCursor() scenario, but in LoadImage() calls. I am puzzled.
Thanks for your help.
Dion
|
|
|
|
|
hello,
I created a dialog based application.I pop up a modal dialog from the menu created in my application.Class midialog is associated with this dialog resource.By mistake i created an obj of this class in the menu handler as shown in code below.
OnMenu()//handler in my application dialog class.i.e.main dialog
{
midialog m_d;
m_d.DoModal();//creating my modal dialog
}
after couple of daysi realized that i wanted the obj not inside the handler but in the class CMainDlg(class of the main dialog).So i removed above code
and tried to declare a variable of type midialog m_d(again,suppose).then i wrote menu handler as
OnMenu()
{
m_d.DoModal();
}
midialog m_d; declared as public variable.But on compilation this code gives error.why?
syntax error : missing ';' before identifier 'm_d'
midialog' : missing storage-class or type specifiers
m_d' : missing storage-class or type specifiers
These errors are given at the declaration statement of variable
please help
thanks
|
|
|
|
|
sayup wrote:
midialog' : missing storage-class or type specifiers
You probably need to include the header where the dialog class is declared.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
hello,
in the parent dialog class i have included the header for my dialog class.is it necesary to declare it at some specific locatuion;like at start of parent class .cpp or whether at start of .h
please help
what might the problem be?
thanks
|
|
|
|
|
You have to include it in the .h file as the variable is declared in the class itself (so in the .h file).
|
|
|
|
|
Hello...
How to convert the font size from pixel to point...
Any ideas ???
|
|
|
|
|
Try something like this:
int RoundDiv(a,b)
{
return (a + b/2) / b;
}
int PixelToPoint(int nPixels)
{
return RoundDiv( nPixels * 72, GetDeviceCaps(GetDC(NULL), LOGPIXELSY) );
}
Hope it helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Big Thx for fast reply...
Believe it's the right thing i need...
|
|
|
|
|
Big Thx... I have make some tests and it works fine...
|
|
|
|
|
Hello
I want to convert my existing Tapi 2.0 application into Tapi 3.0 but i don't
know much about Tapi 3.0. I want to create the Dll and use this dll in VB.
Anyone knows about Tapi 3.0, how it work. Any source code available? please
help me.
Tahnks,
Rajesh
|
|
|
|
|
|
Vivekuniq wrote:
If u know how to use TAPI 2.0 , u'd also know how to use 3.0..
TAPI 3 is a COM based api where as TAPI 2.x is a standard Windows API (dll). They are very different in their approach and concept.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
TAPI 3 is a COM based API. If you know how to use COM in C++ then you shouldn't have any problems with the MSDN samples.
As TAPI3 is COM based, you can probably use it directly from VB.
Of course, depending on your application, you may find that TAPI3 offers nothing that your TAPI2 code doesn't already do.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
Waste of time!
The only reason for convering a 2.0 (or even 1.0) tapi version of an application into the latest version, is if you are going to use features that are provided by the latest version.
Each new version of TAPI contains the interfaces for every previous version of TAPI. Therefore, even if the TAPI DLL on a given system changes, your application will still work.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi, I need to use the Calander control in my MFC dialog app. The user must be able to select multiple days and once selected, when a button is pressed, circle them and/or output the dates.
How would I go about getting data out of the control?
I cant seem to find much help with this topic.
Thanks
Ashley Rowe
I'm normally not a praying man, but if you're up there, please save me Superman.
|
|
|
|
|
Hi,
I don't think you can circle the selected dates, unless you do owner draw, if that is possible with this control. But you can have multiple selection and retrieve the selection easilly. Multiple selection seems to be limited to one week though. Just set the proper attributes (styles).
Also, you might want to look at the BCG Date Time control, which seems to be available for free and might do what you need. http://www.bcgsoft.com/download.htm
|
|
|
|
|
ldaoust wrote:
Multiple selection seems to be limited to one week though.
This is the default value. Sending the MCM_SETMAXSELCOUNT message allows this to be changed.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi, everyone.
I have made dialog, and i call it through button on toolbar. In that dialog there is tree control with checkbox. My Question is when i close the dialog (click button OK), how i save state of tree control so when i call this dialog again the state of tree control same like before i close the dialog.
Thank you.
|
|
|
|
|
When you close the dialog create an in-memory object that can build the tree again as it was when re-loading the dialog.
good luck.
No hurries, no worries.
|
|
|
|
|
Sorry, but how i connect the tree with data/member in other class ?
I make class CMyTabControl (CTabCtrl). In this derived class, there is a struct ZZZ that i want to access.
I make the object of this class in a class View (childviewxxx).
This view is child from the childframexxx,which have the toolbar button that call this dialog. Condition of the tree is connected with the struct.
Thank you.
|
|
|
|
|
there are several ways to do this.
- Use a struct.
- copy the tree into a dummy tree (kept in memory but not shown on the screen)
- use xml and put that in a string.
I think xml will use the least memory, but rebuilding your tree will probably take a little longer.
anyway you can use anything you'ld like as long as you save enough data to rebuild your tree as it was.
good luck.
No hurries, no worries.
|
|
|
|