|
Did you use of CreateCursor for create it and SetCursor for set it?
|
|
|
|
|
I used CreateCursor and SetCursor. It is working in main dialog. But, it is not working in the sliding dailogs. There are two sliding dialogs. I am want to use company logo as a cursor.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
santhoshv84 wrote: But, it is not working in the sliding dailogs.
Are those dialogs responding to the WM_SETCURSOR message?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It sounds like you need to handle WM_SETCURSOR in your sliding dialogs. But this would only handle the cursor on the dialog itself, not on any buttons, static controls etc. To handle all those cases would be possible by using subclassed controls also, but it sounds like rather a lot of work...
You also have the separate problem of turning an arbitary bitmap into a cursor!
Iain.
|
|
|
|
|
Are the sliding dialogs coordinates fixed?
You can get the dimensions and position of the dialogs. Then get the position of the mouse according to the main frame or the desktop and, if you are inside of the region ocuped by your dialog when is visible... then change the cursor to the one you want.
I made it in my project when being over one bitmap (that represents an element that can be configured in advanced window), and changing cursor depending on the element.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
MY application do the word automation. My problem is while i quit the word through my application it will close all the word document , which i not open through my application. Pls help me to close the word document which i open through my application .
Thanks in advance
|
|
|
|
|
|
i open it by
pDisp is
hResult = CLSIDFromProgID(L"Word.Application", &cLswid);
CoCreateInstance(cLswid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch,(void **)&pDisp);
pDisp->GetIDsOfNames(IID_NULL, L"Open", 1, LOCALE_USER_DEFAULT,&dispID)
pDisp->Invoke(dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT, autoType, &dp, pvResult, NULL, NULL)
|
|
|
|
|
Use the Close method of the Document object, instead of the Quit method of the Application object.
|
|
|
|
|
Hai experts,
I need to get RTF format of a text...how to gat this...any api or how...using VC++?
Pls help me.....
|
|
|
|
|
I would try this.
a) Create an invisible CRichEditCtrl (or use a visible one).
b) Set the text with SetWindowText (or type or paste it into your control).
c) To get the Text in RTFFormat use StreamOut Method.
There is a small sample in MSDN for this.
If you are not using MFC:
a) Create a Window of richedit class. (CreateWindow(...)
b) use WM_SETTEXT
c) send EM_STREAMOUT - Message to the created window
|
|
|
|
|
It depends what you are trying to do.
RTF is all readable text - create a "Hello world" document using word pad and save it as RTF, then open it using Notepad. That's a minimal RTF document.
If you want to make your own RTF documents from a program, use the contents of that Wordpad-generated file as a basis, just replace the "Hello world" with whatever you need to output from your program.
As I said, it depends what you are trying to do in the RTF document.
|
|
|
|
|
Hello everyone,
I am using Visual Studio 2003. I am writing a JNI program, and upper layer is Java code and lower layer is C code (DLL). The Java code is utilizing C code by JNI.
To debug the C code, in the C DLL Project Properties dialog, I assign Debugging Command to java, then set Command argument to,
-classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld,
when when debugging from Visual Studio, Visual Studio will crash. Do you know anything wrong with the settings?
I have also tried to run manually from command line,
java -classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld
and the result is correct.
regards,
George
|
|
|
|
|
hiiii,
I want to handle WM_NCLBUTTONUP in my doc/view application. I already add this message handler for my window. But it was not responded when my mouse was up in the caption bar of my window.Please give suggestion for how to handle the WM_NCLBUTTONUP?
Thanks in advance...
ss
|
|
|
|
|
First thing I would do is handle (at least as a test) WM_NCLBUTTONDOWN. Its quite possible that something is grabbing the down button, and then capturing the mouse until an UP comes along, bypassing you.
If you can't see the DOWN message, then you've probably not added the handler properly.
Another possibility...
The view itself doesn't actually *have* a caption bar - its provided by the CChildFrame in a non-maximised MDI frame, or the CMainFrame in a SDI app, or a maximised view. So you may be subclassing the wrong window!
Iain.
|
|
|
|
|
hi all masters of vc
i want to know that how can i automaticlly
shutdown and logon system on a particular time in vc++
please help me
thanks
|
|
|
|
|
You can use of WM_TIMER and after a time use of ExitWindowsEx.
|
|
|
|
|
Hello everyone,
I think if we define foo as char array, for example,
char foo [32];
then foo, &foo and &foo[0] should be the same, right?
For example, the following 3 statements are the same,
strcpy (foo, goo);
strcpy (&foo, goo);
strcpy (&foo[0], goo);
Any comments?
I am very interested in how C treats foo and &foo and make them the same?
thanks in advance,
George
|
|
|
|
|
I think that you will find this to be compiler dependent.
foo is the array, so C/C++ treats the array name as a pointer to the array and thus it is a pointer of the same value as &foo[0].
With some compilers however, I have seen where the compiler stores a pointer to the array (like &foo[0] and then &foo is a pointer to that pointer... so I would stay away from this syntax.
Jim
|
|
|
|
|
Thanks Jim,
I have tested that on Visual Studio, foo and &foo are the same. I think you mean on some other compiler, they may be different.
Here is my test program in Visual Studio.
<br />
int main (int argc, char** argv)<br />
{<br />
char foo [1024];<br />
unsigned int p;<br />
unsigned int q;<br />
p = foo;<br />
q = &foo;<br />
<br />
return 0;<br />
}<br />
I am interested in the cases when "&foo is a pointer to that pointer". I am wondering what is wrong if I still treat foo and &foo the same in this situation? Could you provide more information and analysis please?
regards,
George
|
|
|
|
|
I do not recall where I have seen it. It was several years ago on an embedded compiler... seems like green hills or perhaps wind river. If you are using microsoft, I don't think you will have a problem treating foo and &foo as equals.
Jim Fisher
|
|
|
|
|
Thanks all the same, Jim.
regards,
George
|
|
|
|
|
I was a little intrigued by your question, and made up a little test...
UINT p, q;
char foo [100];
p = (UINT)foo;
q = (UINT) (&foo);
ASSERT(p == q);
char *bar = foo;
p = (UINT) bar;
q = (UINT) (&bar);
ASSERT(p == q);
And you were indeed right. foo and &foo were the same value, but bar and &bar were not. Part of the problem is that we're both cheating and looking at the variables as raw numbers (which I find useful to do conceptually), but the compiler has the advantage of looking at them knowing there type.
So foo is a number, but is known to be an array, while &foo happens through an implementation detail you can't rely on to be true on another day of the week to be the same number, but is treated differently as it has a different type (pointer to an array).
Hard casting like you did can be useful, but it can also be dangerous.
Short answer: compiler dependent. If you rely on it, prepare to be shot in the foot.
Iain.
|
|
|
|
|
Thanks Iain,
So, the best practice is not to use &foo?
regards,
George
|
|
|
|
|
There's nothing wrong with using &foo - but not as a number. Use it as a "pointer to an array" and let the compiler worry about location details.
"Is it wrong to do..." is not something I can possibly answer in the general case.
But taking your strcpy example...
char foo [100];
strcpy (foo, "iain"); is fine
strcpy (&(foo[0]), "iain"); is fine, but ugly
strcpy (&foo, "iain"); is syntactically wrong, and I'm surprised you don't get a warning at least. It just happens to work on this compiler.
char *bar = new char [100];
strcpy (bar, "iain"); is fine
strcpy (&(bar[0]), "iain"); is fine, but ugly
strcpy (&bar, "iain"); will fail - and mostlikely crash stuff.
As you see, the only difference between "getting away with it", and "failing" is what's written a few lines up, relying on &array == array is a really bad idea, even if you will always get away with it. Imagine you come back in 3 years, your boss says "this needs to be longer - make it dynamically sized", and your code will crash with you being puzzled.
Iain.
|
|
|
|