|
Yes, we usually can.
(see, for instance, here [^]).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes you can, follow these two steps.
Step 1: You have to declare this DllImport attribute which allow specifying the name of the dll which contains the method.
Step 2: Then you have to specify the signature of the API, after which you can call the method passing the correct parameters.
As for example:
[DllImport("User32.dll")]
static extern bool MessageBox(IntPtr hWnd, string lpText,
string lpCaption, uint uType);
IntPtr hWnd= this.Handle;
MessageBox(hWnd, "Hi", "Click Me", 0);
hWnd is the handle of the form.
|
|
|
|
|
Thank you very much for the answer.
|
|
|
|
|
I am looking for 8bit checksum algorithm for my 15W packet.
Thanks!!!
|
|
|
|
|
resolvequestion wrote: I am looking for 8bit checksum algorithm
Does this help?
"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
|
|
|
|
|
uhm...Adding the f*ing bytes?
(*) fashinating.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
hi,
i need to have the right cursor position , does not matter which font size is being used,
for example if the ::GetCaretPos(lpCursorPos) gave me lpCursorPos-> y = 4
when the font size was 10 it must also give me 4 if the font size is changed to 72,
please help.
Thanks.
|
|
|
|
|
Ok, so what's the problem?
"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
|
|
|
|
|
the problem when i change the font size, i get another y coordinate and i need to have the same coordinate
for all font size from 8 to 72 , is this clear now?
|
|
|
|
|
Have you tried GetSel() ?
"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
|
|
|
|
|
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.
|
|
|
|