|
It is not the function that is dimmed but my printing dialog options from ... to... and select
|
|
|
|
|
Hi,
I need a utility that displays all the colors that you get from GetSysColor. There must be some simple freeware app somewhere that just does this for you!?!
Joel Holdsworth
|
|
|
|
|
What event is sent when I click on an Edit Control that is in a Dialog box?
I want a messagebox to appear when I click on the edit control.
Thanks!
|
|
|
|
|
i think this is not the right answer, but you could try with EN_SETFOCUS
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You can detect focus change via EN_SET/KILLFOCUS. However, to capture LBUTTONDWN, you will need to subclass the edit box.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Do you mean that I capture EN_SETFOCUS... display the messagebox and then with SendMessage deliver EN_KILLFOCUS.
Cause I tryed to capture EN_SETFOCUS and I manage to display the messagebox but it appears 2 times in a row.. strange.
|
|
|
|
|
EN_SETFOCUS has the problem that it is also sent when you select the edit box via the tab button!
Don't try it, just do it!
|
|
|
|
|
Well I used EN_SETFOCUS but ans I wrote before I get the messagebox 2 times.
I only want it to appear when I click on the Edit Control.
|
|
|
|
|
I have to make a server which should be able to make about 1000 connections after booting. Then starts communication proccess in which clients sends short messages(about 10 bytes) to server and server responds whith similar messages to 5 clients after receiving every message from one of the clients. In every moment about 300 clients are sending messages to server. Server also must reconnect broken TCP connections on client request. Can anybody help me about a way to make that kind of application and which tool is better for use:WinSock API or MFC classes CSocket or CAsyncSocket, then blocking or non-blocking sockets etc. Help!!!
|
|
|
|
|
|
Clients use GPRC modems for communication and it should be able to communicate with server and it doesn`t metter which I/O strategy is used.
|
|
|
|
|
Sounds like a major networking project to me, you should probably ask a more specific progamming questions.
|
|
|
|
|
hi,
I change my program to XP style by using a manifest file. But I found that it does not work with the WebBrowser ActiveX control in a dialog. The WebBrowser ActiveX control is still 2000 style.
How to make it use XP style?
Bin, Du
|
|
|
|
|
Hi,
I am googling for about 5 hours now, to find a good tutorial about automating excel.
What I need:
I want to load data from a database into excel, make a chart out of it, and safe it as a html file.
I found some articles concerning this at the msdn. But none helps me out, cause its ALWAYS MFC. And I want to code in straight c++. Next problem is, it always needs special header files like excel.cpp and excel.h, which dont exist anywhere...
Is there any article about excel automation for normal c++ out there?
Word Automation was no problem, but it seems to be different from excel!
DKT
|
|
|
|
|
Have you seen MSDN article Q178749? The MFC-specific parts of that article have nothing to do with the communication with Excel.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Ive seen it, yeah.
Ok, take this link for example:
http://support.microsoft.com/default.aspx?scid=kb;en-us;199691&Product=xlw2K[^]
I did all steps just like the MSDN tells me.
But I get thousands of errors.
First one:
_Application oApp; _Application isnt known.
I imported excel.exe, as I was told, I included the CApplication from the type library, which gives me more and more errors...
I dont understand that. I went the way MSDN told me, and it doesnt work at all.
This topic is hard, therefor I wanted to have an example code to learn from it. But this seems to be impossible, even for MSDN.
DKT
|
|
|
|
|
After importing from the type library, did ClassWizard add a .h and a .cpp file to your project? If so, do they contain a _Application class? Did you #include the .h file correctly?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Yes, I get the h files after importing the library!
The problem is the next step:
Add the include statement for excel8.h after the include statement for stdafx.h at the top of the AutoProjectDlg.cpp program file:
#include "stdafx.h"
#include "excel8.h" // excel.h in the case of Excel 2002 and Excel 2003.
Theres NO excel.h (I am using 2002)
DKT
|
|
|
|
|
Anonymous wrote:
Yes, I get the h files after importing the library!
Theres NO excel.h (I am using 2002)
These two statements contradict each other. If a .h file was created, just #include it, no matter what name it has.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
What do you mean?
I got the specified h files like CApplication.h and stuff...
and yes, I included them, but as I said, get thousands more errors in those h files.
DKT
|
|
|
|
|
Are you saying that ClassWizard created more than one .h and .cpp file? If so, I've not seen that happen before.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hmm... I found a thing that might help me:
http://www.lordjoe.com/Java2Com/CPPCode.html[^]
But I have the problem with the following line:
hr = Invoke(pdispApplication, DISPATCH_METHOD, &vRet, NULL, NULL,
OLESTR("WorkBooks"), NULL);
if (FAILED(hr))
goto error;
I get: "Member not found".
This means WorkBooks is ok, but something is missing, had the same before for another method.
My question: I am searching for a reference to find the detailed properties for those methods. How to find out, how to invoke those methods correctly?
Damn, C++ and OLE is quiete hard...
DKT
|
|
|
|
|
Anonymous wrote:
How to find out, how to invoke those methods correctly?
See MSDN article Q222101.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Ok, I could solve my problems till now. Thanks for that David!
But I still dont see what methods I can use and which not.
For example: I record a macro which runs another macro.
I see the vb code:
Application.Run
So, If I try to use Invoke with Run as OLESTR, it says "unknown". But other things like add or range work.
What is the methods name for run? Isnt there any paper for all possible methods for non-MFC based c++ OLE code?
MSDN says itself:
C/C++ Automation is much more difficult, but sometimes necessary to avoid overhead with MFC, or problems with #import. Basically, you work with such APIs as CoCreateInstance(), and COM interfaces such as IDispatch and IUnknown.
Yeah, it is difficult, but is it impossible?
Anyway, thanks alot for your help till now David, it helped alot.
DKT
|
|
|
|
|
I have an Excel file with a macro named DisplayMsg. To open that file and run that macro, I used:
_Application app;
Workbooks books;
_Workbook book;
COleVariant vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
vtTrue((short) TRUE),
vtFalse((short) FALSE);
if (app.CreateDispatch("Excel.Application") == TRUE)
{
books = app.GetWorkbooks();
book = books.Open("C:\\Book2.xls",
vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional,
vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional);
app.Run(COleVariant("DisplayMsg"),
vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional,
vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional,
vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional,
vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional,
vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional);
} Does that help any?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|