|
I forgot to check the dialog template in resource editor
I just changed "Default button" propoerty from OK to "Insert" button.
------------------------------------------
Experience is the name every one gives to their mistakes.
-- Oscar Wilde
Experience is one thing you can't get for nothing.
-- Oscar Wilde
|
|
|
|
|
Under Visual C++ NET the print preview in MFC can be performed only within the MDI child frame and not anymore within the main application frame as before. Does anybody know the way to get the former behavior?
Thanks!
|
|
|
|
|
Does any one know how we can reverse engineer MFC code in rational rose 2000? i've already gone through the help in rational rose and most of the stuff is outdated
|
|
|
|
|
HI,
I have to read the icons for different file types and display them .
Now if i load the common icons from a resource script it wont suffice .
as for a new/different file type it does not work . So it is obvious that
it has to be read from the registry . ( my application uses win32 api)
Any help will be appreciated.
thanks
Suman Ray
|
|
|
|
|
Look up SHGetFileInfo in the Platform SDK.
As I remember, Paul diLascio (MSDN) did a series of C++Q&A articles on all this.
Iain.
|
|
|
|
|
thanks you can do it that way,
discovered another api .
ExractAssociatedIcon(also a shell api ) to do it .
regards
Suman Ray
|
|
|
|
|
Does anyone recognize this value? Would be very helpful right now...
I get an (rare) error condition where some buffers are filled with 0xFEEEFEEE. It could be a usual allocation problem (but the CRT Debug heap doesn't seem to use this), or from a call into a 3rd party library which in turn passes the buffer into a kernel mode driver.
TIA
Peter
Those who not hear the music think the dancers are mad. [sighist] [Agile]
|
|
|
|
|
The C libraries fill memory formerly occupied by an allocation with this pattern when
it is deleted.
So, you're trying to use a deleted block of memory.
-=jarl
Look here for more on memory fill-codes
http://www.docsultant.com/articles/debug_codes.html
-=jarl=-
|
|
|
|
|
hi
to draw a String with GDI+ :
graphics.DrawString(L"Hello", -1, &font, PointF(600,100), &solidBrush);
how can i change an integer to WCHAR in parameter 1.
for exmple i want to draw figures from 1 to 100.
thanx
|
|
|
|
|
char tmp[4];
for(int i = 1 ; i < 100 ; i++) {
sprintf(tmp, "%s", i);
graphics.DrawString(tmp, -1, &font, PointF(600,100), &solidBrush);
}
You can also use eg std::string and boost::lexical_cast, but this is the simplest form I guess
HTH
|
|
|
|
|
roel_v wrote:
sprintf(tmp, "%s", i);
You obviously meant:-
sprintf(tmp, "%d", i);
|
|
|
|
|
Yes I did - shame on me
|
|
|
|
|
looks like that u wanna use unicode
CString blub;
for (int i=0;i<100;i++)
{
blub.Format(L"%i",i);
graphics.DrawString(blub, -1, &font, PointF(600,100), &solidBrush);
}
...
|
|
|
|
|
When my application run it is shown in Taskbar,how can I prevent it?I want to use systemtray icon instead of it.I know how to show it in systray,but I don't know how to hide it from taskbar.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
this[^] should help you.
Cheers
Kannan
|
|
|
|
|
Thanks.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
How can i obtain the process handle of any process under execution ??? Actually, i am writing an application that can terminate any process. For this purpose i am using API TerminateProcess():
BOOL TerminateProcess(<br />
HANDLE hProcess,<br />
UINT uExitCode<br />
)
As can be seen from the syntax, the first argument is the process handle. How can i obtain this handle when i only know is the process name ???? Is there any other alternative you suggest me instead of TerminateProcess() ???
|
|
|
|
|
For this you need to look on the following API's
CreateToolhelp32Snapshot for a snapshot of running process on your machine and on successful exec. of this function you need to iterate the processes using Process32First followed by Process32Next.
Also look at the following API's in MSDN
GetProcessModule
OpenProcess
HTH
Cheers
Kannan
|
|
|
|
|
Is it possible to have an MFC document template be able to open multiple file types?
(whatever.bla and whatever.beh for example)
|
|
|
|
|
You have to manually edit the IDR_XXXXTYPE string in the resource file to add your file types to the
File Open box.
If you search MFC for a function called
CDocTemplate::Confidence CDocTemplate::MatchDocType(LPCTSTR lpszPathName, CDocument*& rpDocMatch)
{
}
It will show how MFC chooses which template to use for any given file type. You can inherit from
C(Multi/Single)DocTemplate, and override this function to do clever "type choosing things".
You'll have to remember to trivially override the construction member as well...
As before, I hope this gives you pointers...
Iain.
|
|
|
|
|
Thanks, but what do I put in the string? I tried doing it like normal open file dialogs, but |s didn't work and I don't know what else to try...
|
|
|
|
|
What string? You mean the lpszPathName or what?
|
|
|
|
|
I may have been misleading you... I misremembered how I did the project I thought I had this
feature in. The string I meant was as follows:
// Normal
JigSaw\n\nJigSaw\nJigsaw Image (*.jig)\n.jig\nJigSaw.Document\nJigSaw Document
// Edited...
JigSaw\n\nJigSaw\nJigsaw Image (*.jig;*.jpg)\n.jig;.jpg\nJigSaw.Document\nJigSaw Document
OR
JigSaw\n\nJigSaw\nJigsaw Image (*.jig;*.jpg)\n.jig;*.jpg\nJigSaw.Document\nJigSaw Document
If those two possibilities don't work, then you'll have to use the OpenFileName function
yourself by over-riding the CWinApp::OnFileOpen () function.
Loosely, and with a lot or error correction cut out:
void CZeusApp::OnFileOpen()
{
CFileDialog fDlg (TRUE, "JIG", NULL, 0, "Jigsaw Image (*.jig;*.jpg)|mdf;*.dat|All files|*.*||", AfxGetMainWnd ())
if (fDlg.DoModal () != IDOK)
return;
OpenDocumentFile (fDlg.GetPathName ());
}
This wouldn't handle multiple files etc, but it will give you a start.
Iain.
|
|
|
|
|
Respected sir/madam
my problem is how to call the api's viz
GetTcpTable & SetTcpEntry???
These are available in the dll file "iphlpapi.dll" but when i include the header file iphlpapi.h it is showing two errors as follows
1) unknown pragma #pragma option
2) cannot include header file iptypes.h
i also tried loading the dll using LoadLibrary & invoke the above told functions using the GetProocAddres function.
But this shows assertion failure....
so kindly do tell me how to invoke those functions...
prince
|
|
|
|
|
I don't know what's wrong with header file.
About DLL:
Make sore that function poiters are CALLBACK as:
typedef void (CALLBACK* SomeName)(BOOL, and so on..)
viliam
|
|
|
|