|
dsclee wrote: There are inbuilt dialogs in MFC that do what I'm trying to achieve, but are added as a property on the resource.
I have no idea what that means. what is an "inbuilt dialog"? And how do you add a dialog as a property?
dsclee wrote: For example if you set a field to "Password: True" whenever you press Caps Lock within the field a tooltip (balloon style) appears at the caret position, rather than at the mouse position.
Well a tooltip isn't magical, it's just a window, take a look at one in Spy++. You can make a window do anything you want including set it's position.
|
|
|
|
|
I wrote a c++ ATL dll, and now want to call it from another c++ app. What exactly do I need to do be able to call it?
In the h file for the ATL dll
STDMETHOD(MyFunction)(BSTR OutputDirectory, BSTR DlgTitle, BSTR BatchFileName, BSTR ResultsFileName, int ObjectStartNumber);
plus other functions
I tried to include this h file but got these errors:
error C2079: 'CSFilter' uses undefined class 'ATL_NO_VTABLE'
error C2239: unexpected token ':' following declaration of 'CSFilter'
error C2059: syntax error : 'public'
error C2448: '<unknown>' : function-style initializer appears to be a function definition
fatal error C1004: unexpected end of file found
Error executing cl.exe.
thanks,
sb
|
|
|
|
|
ns wrote: I tried to include this h file but got these errors:
ns wrote: error C2079: 'CSFilter' uses undefined class 'ATL_NO_VTABLE'
CSFilter Sorry, that is ATL_NO_VTABLE is undefined. You have not included the definition for it in your project.
|
|
|
|
|
I just took the .h file straight from my ATL dll project and did a #include in the test harness project.
What is it I need to do?
thanks,
sb
|
|
|
|
|
ns wrote: What is it I need to do?
You need to configure your project to include any dependent header files and resolve any dependent library files to successfully compile and link.
|
|
|
|
|
Hi all,
please help me to read stderr (such as netstat -n) in my Win32 Application.
Read stderr put into a pipe and then get data in this pipe put to string
thanks
|
|
|
|
|
What did you try so far?
Waldermort
|
|
|
|
|
WalderMort wrote: What did you try so far?
Posting questions in forums... Duh
|
|
|
|
|
one of my first ever projects an app that simulated the unix pipe. yeah I know you can pipe in the old DOS too but it was fun to create my very own piper
|
|
|
|
|
I want to get value of command "netstat -n" in my Win32 Application
If you known the way to perform this task , please help me
thanks
|
|
|
|
|
sukem wrote: the way to perform this task
Maybe this[^]
|
|
|
|
|
See here and here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
The output of the command line application 'netstat -n' will write to STDOUT, not STDERR. However you can redirect them both. Here is an example of how to achieve your goal.
http://www.codeproject.com/threads/redir.asp[^]
Best Wishes,
-Randor
|
|
|
|
|
Many thanks you all helped me on this thread
Everything seem that is difficulty
Let me describe again
Assume you create new Win32 Application project with select "a typical Hello Word ! application ". When you execute this project, system will show a window contain "Hello Word !" string.
I expect to replace string "Hello Word!" with value of cammand "netstat -n"
Example: replace "Hello Word !" with
"Proto Local Address Foreign Address State
TCP 127.0.0.1:1148 127.0.0.1:1149 ESTABLISHED
TCP 127.0.0.1:1149 127.0.0.1:1148 ESTABLISHED
TCP 127.0.0.1:1150 127.0.0.1:1151 ESTABLISHED"
many thanks
|
|
|
|
|
created project Win32 Application and use this is function that help me to archive my goal
[code]
DWORD RunSilent(char* strFunct, char* strstrParams)
{
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInfo;
char Args[4096];
char *pEnvCMD = NULL;
char *pDefaultCMD = "CMD.EXE";
ULONG rc;
memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_HIDE;
Args[0] = 0;
pEnvCMD = getenv("COMSPEC");
if(pEnvCMD){
strcpy(Args, pEnvCMD);
}
else{
strcpy(Args, pDefaultCMD);
}
// "/c" option - Do the command then terminate the command window
strcat(Args, " /c ");
//the application you would like to run from the command window
strcat(Args, strFunct);
strcat(Args, " ");
//the parameters passed to the application being run from the command window.
strcat(Args, strstrParams);
if (!CreateProcess( NULL, Args, NULL, NULL, FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&StartupInfo,
&ProcessInfo))
{
return GetLastError();
}
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
if(!GetExitCodeProcess(ProcessInfo.hProcess, &rc))
rc = 0;
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
return rc;
}
[/code]
I run this function with argument:
RunSilent("java -version","2>> javaVersion.txt");
many thanks you all helped me more
|
|
|
|
|
Hi.
I want to retrieve the response, by sending a request with an Agent name to a http server.
Can anybody please help me.
Thanks.
Kishore
|
|
|
|
|
|
Hi Friends,
Im using a dialog based window.which is used to enter some text & then
I want to generate a RTF report & print it.
Any help will be appriciated.
Thanks in advance.
Reagards
Shiva
|
|
|
|
|
Shivarudrayya wrote: Any help will be appriciated.
Read the first message in the thread titled "How to get an answer to your question" pay attention to item #2.
|
|
|
|
|
Hi, i'm trying to draw EMF or WMF files in an antialiased way.
I tried GDI+, AA drawing is ok when using DrawLine or other primitives but the DrawImage doesnt produce
AA output when beeing passed a Metafile object containing a WMF or EMF
So is there a way to draw EMF/WMF files with antialias ? (with or without gdi+)
Maybe something exists in order to convert EMF/WMF to EMF+ ? (it seems gdi+ can only AA on EMF+ files)
thanks for your help
|
|
|
|
|
hi all
i have five list control in report mode on my single dialog when i click one and go to second,third,fourth and five by clicking the cell of list control i want to change the color of cell of list control only where i click the particular cell of list controls,
how can i do this,reply please i will be so greatful
thank u in advance
malik
|
|
|
|
|
Anything in Windows that there's not a documented interface for, you can usually accomplish through Windows subclassing.
In your case, to sketch out a solution, you would subclass the list control window, and then handle in all liklihood WM_PAINT. On that message, you would send LVM_GETITEMRECT to the list control window, and get the bounding rect of the list control cell you were interested in. Then just BitBlt whatever color you want to the hdc of the window, using the dimensions of the rect you retrieved (possibly using PATBLT for a ROP code, first setting the hdc brush to the appropriate color.) So that's the basic idea.
Actually, although I'm not sure I entirely understood you, the above solution might not work if you BitBlt to the cell and then the original WinProc writes text over it, as the textbackground color may be wrong, unless its being drawn transparent. Of course, there's SetBkMode to make the text background transparent, but I don't know how you get this to work for the hdc the original WndProc is writing to. It looks like you've got some work to do on your own, but its certainly not impossible. Also there's LVM_SETTEXTBKCOLOR, FWIW.
-- modified at 11:09 Thursday 25th October, 2007
|
|
|
|
|
LVS_OWNERDRAWFIXED the list-view control sends a WM_DRAWITEM message to paint eachitem
|
|
|
|
|
please give some light on your approach because i am new for mfc
malik
|
|
|
|
|
do an article search for lvs_ownerdrawfixed. there are two that look particularly interesting to solve your dilemma, one by Muhammad Azam[^] and one by Piotr Szewczyk[^]
|
|
|
|