|
i am using CRichEidtView Class it does not have GetSel(), i need to get the font hight which is NOW used to display the text and every time this font size changed i must get the the actual font size , textMetric may be help but i need to initalize a CClientDC or CDC , in CRichEditView Class this diffecult.
|
|
|
|
|
richEditView.GetRichEditCtrl().GetSel
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
okay this sounds good i will try thanks.
|
|
|
|
|
susanne1 wrote: i am using CRichEidtView Class it does not have GetSel()...
Sure it does.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi Guys,
I can't seem to find any articles on how the OS Mutex's behave if they are not closed. I'm looking to use a mutex handle to check whether there are instances of various applications open prior to running an installer, but one of the apps is a C++ app, and in the event of a catastrophic failure, it may end a process without releasing the underlying Mutex.
What effect would this have on the system? Would the Mutex state be invariant, or does ending the holding process free the mutex as well?
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Please use the documentation of CreateMutex[^] as a reference.
The mutex will be automatically released when the process terminates.
Here is a snippet from the documentation -
The system closes the handle automatically when the process terminates. The mutex object is destroyed when its last handle has been closed.
The documentation makes some recommendations to check for application instances.
Here is a snippet that explains this -
If you are using a named mutex to limit your application to a single instance, a malicious user can create this mutex before you do and prevent your application from starting. To prevent this situation, create a randomly named mutex and store the name so that it can only be obtained by an authorized user. Alternatively, you can use a file for this purpose. To limit your application to one instance per user, create a locked file in the user's profile directory.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Cheers, i wasn't entirely clear on whether the Mutex would self release after a Process exits from a catastrophic failure.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
If nobody owns up for a mutex (orphaned), the OS immediately closes it. Also, locked file idea suggested in the docs may not be very helpful if you want your application to be truly one-instance (across logins). But, in such a case, only a kernel object (like Mutex) can help you.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hi, i created a custom MFC dialog box, and I need to call it in a function in a dll file, but when i call it it keeps saying IDD_BOX undeclared identifier, even though i've included the dialog box's header file. how do i call a dialog box in a dll file?
|
|
|
|
|
Are you sure that IDD_BOX is really defined?
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
yes because the dialog box app compiles and runs by itself without any errors? so its defined there and working
[edit] ok its compiling now, all I did was repalce the #include ...filedlg.h with #include ....filedlg.cpp, and am not getting the erorr anymore. will see if its running properly once I create a test file using that dll. thanks for the help for now _AnsHUMAN_. if you have anything to add regarding this, please do so that I may know what you had in mind [/edit]
modified on Thursday, July 16, 2009 7:41 AM
|
|
|
|
|
Hello,
When I run my program in debug mode that is by pressing F5 the program runs properly and the text or windows which are to be seen are seen on the view but when I press Ctrl F5 and execute the program the text or windows are not seen on the view.
What must be the problem ?
pritha
|
|
|
|
|
read this : Surviving the Release Version[^]
and go back to your source-code, re-check everything and come back when you have more precise information and/or small source code extract that shows the problem.
This signature was proudly tested on animals.
|
|
|
|
|
Well, in my computer it's a reverse situation, I use VS2005.
Ctrl+F5 means execute without debuging, and text or windows could be seen.
F5 means debug, and press it text or windows couldn't be seen.
|
|
|
|
|
It's quite possible that the working directory is different for the F5 and Ctrl-F5 run.
If you are opening any files be sure those files exst - best way is to supply a complete path name to your open routines, not just the filename.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
|
Hi all!
I want to design and implement an e-voting(electronic voting) system with two computers(one as server and the other as client) under windows;
What technology or programming model do you suggest me for this purpose?
I'm not familiar with network programming models in windows and need help of experience people!
One guy have suggested me to create an ActiveX on client and communicate with server through COM, what do you think about it?
Please help me!!!
Best Regards.
|
|
|
|
|
Personally, I'd probably approach it by exposing a web-service[^] interface on the server that the client could use.
I wouldn't use COM because I've heard too many painful things about configuring COM to work across multiple machines. But that's just my prejudices
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i have created a dialog and the dialog font size is different with my friend (all the setting in a property page is totally the same). Have anyone face this problem before?
|
|
|
|
|
He might be using different Font (DPI) settings.
|
|
|
|
|
Thank for the reply.
I make mistake in here. I din mention that the font i use is all in capital latter. that why mine font is biggest than my friend..sorry..
|
|
|
|
|
Hello,
is it possible to create an object with the CRuntimeClass-pointer and call a specific constructor during the creation, similar to the function new?
Maybe I can combine the CRuntimeClass-pointer with the funktion new?
CRuntimeClass* pRTC
CObject* pOb = pRTC->CreateObject();
CObject* pTestObj = new CTesObj( 5 )
|
|
|
|
|
If CTesObj is derived from CObject, then "CObject* pTestObj = new CTesObj( 5 )" is what you want.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you for your answer, but my problem is another one:
CTestObj ist derived from CObject.
So I can create the objekt with new, like
"CObject* pTestObj = new CTestObj( 5 )"
But I will create the object with the runtimeclass-pointer (CRuntimeClass* pRTC).
This pointer knows the type of the class and I can create the object with the
CreateObject-function.
CObject* pObj = pRTC->CreateObject();
The CreateObject-function calls the standard-constructor.
Can I call another constructor during creation with runtimeclass-pointer?
The next line did not compile but maybe you can modify it:
CObject* pMyObj = new pRTC( 5 );
At the time of creation, I only know the runtimeclass-pointer and the transfer
parameter (5).
In my program the transfer parameter is a big class. So I will save time during creation.
Do you have an idea?
|
|
|
|
|
Good morning ,
got a question to the following code piece which converts ansi text to UTF8.
void SynthesizerSvox::ANSI2UTF8( char* text, int size, char*& result )
{
const int SIZE = 10240;
if( result )
{
delete [] result;
}
result = new char[SIZE];
WCHAR w[SIZE]={0};
int erg=0;
erg=MultiByteToWideChar(CP_ACP, 0, text, -1, w, SIZE / sizeof(WCHAR));
erg=WideCharToMultiByte(CP_UTF8, 0, w, -1, result, SIZE, 0, 0);
}
I found the code somewhere on the net (thanks!) and it works nicely. Only I´d like to work with dynamic memory allocation (don´t like to limit it) and can´t seem to get it done. The number of bytes used per character vary in UTF8 character set.
Is there a solution to this?
Souldrift
|
|
|
|