|
Yanshof wrote: RegistryCall.obj : error LNK2001: unresolved external symbol "private: static bool CRegistryCall::m_bExistObject" (?m_bExistObject@CRegistryCall@@0_NA)
When you use a static variable in a class you need to initialize it with some value in the .cpp file.(or outside the class) SO for the variables that you are using as static (eg for m_bExistObject) put this line on top of the .cpp file.
bool CRegistryCall::m_bExistObject =true;
and you can do like wise for the other variables too...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
if u writing in a console application then in the project-- settings options,
set use mfc in a shared dll option. it will work out
|
|
|
|
|
raghuji.rao wrote: if u writing in a console application then in the project-- settings options,
set use mfc in a shared dll option. it will work out
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Yes you need to two lines to your code in cpp file
bool CRegistryCall::m_bExistObject =true;
And also for cRegistryCallObject
|
|
|
|
|
hi all,
I have a CRichEditCtrl created on CView derived class.
After Creating the Rich edit control it's default font is something different than what i want. and it's bold also.
so to chnge the font i am selecting all the data present in control and then
applying new font to it.
but when i paste the data that is not compatible with mine font again i need to select all the data and then apply font on it!!
so my question is that is there any way to change the clipboard data's font
so that my control will receive data in compatible font only..
or is there any way that whatever font i want my rich edit control to have
i should tell it before creation as some parameter..(i think this shouls be the way )
means if i want that my rich edit control should have only this font say "courier new" and it is going to be fix for all it's lifetime then
i should create rich edit that starts with this font only??
if anybody know's please reply..
Thanks and Regards
Harshal shete
|
|
|
|
|
harsha_1234 wrote: is there any way that whatever font i want my rich edit control to have
I have solution for this.....
Declare CFont *c; reference in the class .
If you want if for lifetime
you have to add the following code in OnInitDialog where m_pRichEdit is variable of RichEditCtrl ....
c=new CFont();<br />
c->CreatePointFont(180,"Monotype Corsiva");<br />
m_pRichEdit.SetEventMask(m_pRichEdit.GetEventMask() |ENM_CHANGE);
Then Just make method for RichEditControl Text Change.
Write Following statement in it.
GetDlgItem(IDC_RICHEDIT21)->SetFont(c);
You can take font name as parameter and provide it to the CreatePointFont method of CFont. You will get the desired output.
Hope This will help you.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Hi i Tried this it is applying the font but the boldness of the font is still there i want to disable the boldness also..
|
|
|
|
|
For more Font Specification you can use the CreatePointFontIndirect() API.
This API uses pointer of the LOGFONT.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Hey i am sorry,
it's boldness is also disabled now.
but now the only problem i am facing is that whenever i paste
saomething in the control it's font remains same..
so i am thinking of something like this whenever user say's Paste.
i will change clipboeard data's font and boldness as i want.
Is this a good approach???
please Guide me as i am not very much familiar with this control
Thanks and Regards
Harshal
|
|
|
|
|
Create a eventhandler for RicheditCtrl on EN_CHANGE
Write Following statement in it.
GetDlgItem(IDC_RICHEDIT21)->SetFont(c);
This will give the desired output.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Thank You very much for your help.
it is working very fine.
Thank's.
|
|
|
|
|
But Apart from this i have another query
i am doing undo redo also.
it is working fine but in undo as well as redo there is one small problem
that whenever i undo/redo then after every undo/redo operation it selects some text and then on next undo/redo it undoes/redoes the character that was typed.
how i can fake the middle selection between two operations??
undo code is like this
if (m_rich.CanUndo())
{
m_rich.Undo();
}
Thanks and regards
Harshal
|
|
|
|
|
Hello everyone. i am trying to upload some Files to an FTP server using CFtpConnection::PutFile() function. Now, how can i detect the loss of FTP connection (if any) while uploading files?? Thanks...
vijay.
|
|
|
|
|
I have a Window which has many client windows. I would like to know the position of all the client windows with respect to the parent window co-ordinates. How do I do it?
I tried using GetWindowRect but it return the rect with respect to the Screen co-ordinates.
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
|
|
|
|
|
First use GetWindowRect to get the coordinated in screen coordinates. Then you can use the ScreenToClient to convert then to coordinates relative to the client area of a window you specify.
Steve
|
|
|
|
|
|
yes, it's easy to show 16 bit color, but when we show 256 or true color icon in system tray, it can't be correctly showen, I have read this article: http://www.codeproject.com/shell/systray24code.asp[^], but sitll can't resolve my problems, you can use visual studio.net's default icon, like the IDR_MAINFRAME, it's a 24 color icon, but cann't correctly show this icon, it seems it's a 16 bit color icon.
Can anybody help me, thanks.
|
|
|
|
|
my os is win2000, perhaps 24 color can only be applied in winxp
|
|
|
|
|
|
I want to create a button when I will click that button some action should occur.But it should look like 3D coloured (for example on/off switch of Television)
I am able to put the bitmap on the command button.But the bit map doesnt fit properly.Because command button is rectangle look,but the bit map is oval shape.Any other way to represent
|
|
|
|
|
Did you see buttons on codeproject?
|
|
|
|
|
Hi all, I am trying to get the string supplied as a param in this function to be displayed as window title when executed but I am gettin compiler error.
here is the code which is causing compiler error
<br />
hwnd = CreateWindowEx( NULL,<br />
"AeroClass",<br />
"Aerobatics by Scody",<br />
WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,<br />
100, 100,<br />
500, 500,<br />
NULL,<br />
NULL,<br />
hInstance,<br />
NULL);<br />
and the compiler error is
<br />
c:\visual studio 2005\projects\aerobatics\aerobatics\aerobatics.cpp(132) : error C2440: '=' : cannot convert from 'const char [10]' to 'LPCWSTR'<br />
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<br />
c:\visual studio 2005\projects\aerobatics\aerobatics\aerobatics.cpp(149) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [10]' to 'LPCWSTR'<br />
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<br />
Can anyone please help me in gettin this string displayed on the window title when executed.
Thanks
Scody
|
|
|
|
|
Your project settings are set to use Unicode, but you're passing single-byte strings. Either switch to the multi-byte character set or use the _T macro on your literals.
|
|
|
|
|
Use
hwnd = CreateWindowEx( NULL,<br />
_T("AeroClass"),<br />
_T("Aerobatics by Scody"),...
|
|
|
|
|
I changed my project settings to use multi-byte character set and it worked!
Thanks very much!
Scody
|
|
|
|