|
Well it does compile fine. It just doesn't run fine!
But nevertheless, I tried defining _WIN32_WINNT 0x0500 in StdAfx.h, and rebuilt the whole thing, and now it even crashes in the toolbar classes and all sorts of other places
What do you mean by a vtable? Isn't a vtable the virtual lookup table used in virtual functions? Or am I missing something?
Also, it doesn't make sense to have multiple builds... I mean all the other software out there has a single install for 98/Me/2000/Xp ???
Thanks!
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Swinefeaster wrote:
Well it does compile fine. It just doesn't run fine!
I know.
Swinefeaster wrote:
Also, it doesn't make sense to have multiple builds... I mean all the other software out there has a single install for 98/Me/2000/Xp ???
May be. You could end up with a proxy dll that will, depending on the OS on which it's running, will load one of two child dlls : one for systems that don't support alpha-blending, one for those which do.
Back to real work : D-27.
|
|
|
|
|
I downloaded this sample from MSDN about enumerating processes under Win9x. It uses Psapi.dll (so includes Psapi.h) to access functions used to retrieve all running processes, here is the code:
#include <<windows.h>>
#include <<stdio.h>>
#include <<psapi.h>>
void PrintProcessNameAndID( DWORD processID )
{
char szProcessName[MAX_PATH] = "unknown";
HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ,
FALSE, processID );
if (NULL != hProcess )
{
HMODULE hMod;
DWORD cbNeeded;
if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod),
&cbNeeded) )
{
GetModuleBaseName( hProcess, hMod, szProcessName,
sizeof(szProcessName) );
}
else return;
}
else return;
printf( "%s (Process ID: %u)\n", szProcessName, processID );
CloseHandle( hProcess );
}
void main( )
{
DWORD aProcesses[1024], cbNeeded, cProcesses;
unsigned int i;
if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
return;
cProcesses = cbNeeded / sizeof(DWORD);
for ( i = 0; i < cProcesses; i++ )
PrintProcessNameAndID( aProcesses[i] );
}
Now when i try to compile this is compiles fine, but when it runs it gives me the error: "The PSAPI.DLL file is lonked to missing export NTDLL.DLL:NtAllocateVirtualMemory"
Now i did a search for NTDLL.DLL and it is in my windows system directory, so i opened it up with Dependency viewer and it could not find a function NtAllocateVirtualMemory.
Now what is wrong here? do i have a wrong DLL?? Even if i did, there is another question i asked myself. You see i opened up Taskmon.exe in Dependency viewer and it just uses the standard libraries like GDI.DLL, USER32.DLL, etc...
So it has to be possible to enumerate processes without the PSAPI so you can avoid the DLL problem. I wouldn't know how though...
If anyone has any ideas, please share them, any help is appreciated.
Thanks
Kuniva
--------------------------------------------
|
|
|
|
|
I have this exported function in NTDLL.DLL. And am running W2K SP2.
Back to real work : D-27.
|
|
|
|
|
I forgot to tell you, PSAPI.dll is not for W9X systems. It's too bad you got the sample from MSDN and you didn't get the sample in full length.
On W9X, you use CreateToolhelp32Snapshot and an enumerator. Searching MSDN with PSAPI as keyword brought me the full length sample in rank 1 ! And you have to switch case all possible OSes.
Back to real work : D-27.
|
|
|
|
|
I have a rather large dialog application that really needs a line drawn to divide it into two sections. Its a serial communcations dialog and the top part handles sending out data (32 user filled edits) while the bottom section is responsible for displaying incoming messages ( 14 read-only edits). I have no problem with the Tx/Rx aspects but I would really like to draw a line between the two. I have no experience whatsoever in this area and am looking for an answer that is detailed enough that I can insert it into my code. I created the dialog using the VS 6 project wizard if that matters. From the small amount of reading I've done (looking in CPaintDC and related items in the MSDN library) I didn't get to far. I am sure I can figure this out if I take the time to go through it in detail but I would really appreciate it if someone would just give me a either a walk through or the code I need. If more info is required just ask... I will provide whatever is needed
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
|
|
|
|
|
Forget CPaintDC, add a groupbox and make it as thin as 1 pixel height.
If you can't, because you use grid locking and stuff, just go the hardcore way : open the .rc file and set the 1 there.
Back to real work : D-27.
|
|
|
|
|
As far as I know, I haven't set any grid locking. But I haven't ever delved into this aspect and if you could some code I could either paste or use as a guideline I would truly appreciate it
---------------------------------------------
<i>The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?</i>
<i> - Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!</i>
|
|
|
|
|
You didn't get it right;P. You just need your mouse! in the dialog editor. Insert a groupxbox control, and resize it.
Back to real work : D-27.
|
|
|
|
|
okay.. let me try that...
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
|
|
|
|
|
sorta does the job.. but the line it draws in faint.. how can I make it darker?
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
|
|
|
|
|
To get a solid black line, use a statement like the following in your .RC file:
CONTROL "",IDC_STATIC,"Static",SS_BLACKRECT,262,295,142,1
In IDE terms, this is a 'picture' control, with the type set to 'Rectangle' and the color set to black. In actuality, it is a static control with the style SS_BLACKRECT, which draws a black rectangle.
Software Zen: delete this;
|
|
|
|
|
Use a picture control and set its type to Rectangle, then adjust it to the size you need. Default color is black but it also supports white and gray. If you need the thickness smaller than 5 dialog units, temporarily set your layout grid height to a smaller value.
|
|
|
|
|
Hello,
I want my program able to burn a CD/DVD. Could you give me a bit of idea how to support cd burning in my application? Do you know any good quality cd burning library?
Thanks!
|
|
|
|
|
If your program will only run in Windows XP, you can use the IMAPI API. If you need other platforms, you'll need some 3rd party products and APIs.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Download NEROs Burning SDK. I don't know the URL but go to NEROs website and search there!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
|
Using VC7
I'm very new to MFC, but I know the general workings of the language pretty well
OK, so the little wizard made me a nice app... right... but now I want to edit that nice little thing...
1) How do I stop that one new decument from popping up at start?
2) void CIceBuilderView::OnDraw(CDC* /*pDC*/)
Why is the pDC commented out by default?
3) How can I make the client window use scrollbars? Currently child windows can get missing out of the client window area...
|
|
|
|
|
Locked Ghost wrote:
1) How do I stop that one new decument from popping up at start?
Override CWinApp:OnFileNew()
Locked Ghost wrote:
2) void CIceBuilderView::OnDraw(CDC* /*pDC*/)
Why is the pDC commented out by default?
You are probably talking about a header file. In headers, definitions do not need param names. Param type is enough for the compiler. Remember a header file is NEVER mandatory, just a nice way to program.
Locked Ghost wrote:
3) How can I make the client window use scrollbars? Currently child windows can get missing out of the client window area...
A typical app uses a CScrollView document/view model, hence scrollbars are automatically managed.
I recommend you read "Windows programming with MFC", MSPRESS, Charles Petzold.
Back to real work : D-27.
|
|
|
|
|
Thanks, that helped.
I have a few more questions:
How can I create a window that stays on top of the other child windows like a floating toolbar?
How can I then tell that window to update itself? (I want it to update when the current view is changed. I think I can figure out how to see if it's changed)
How can I load the contents of a BMP file from memory, into a... CPicture, was it? and then how can I draw a (square) part of that to the view with a transparent colour? And without a transparent colour(Parts of the BMP are opague, but not all)?
|
|
|
|
|
Locked Ghost wrote:
How can I create a window that stays on top of the other child windows like a floating toolbar?
I won't show you how to do this. That's an annoying habit.
Locked Ghost wrote:
How can I then tell that window to update itself? (I want it to update when the current view is changed. I think I can figure out how to see if it's changed)
Windows (whether CView or not) update themselves already. If you want to force an update, you've got to call CDocument::UpdateAllViews(...).
Locked Ghost wrote:
How can I load the contents of a BMP file from memory, into a... CPicture, was it? and then how can I draw a (square) part of that to the view with a transparent colour? And without a transparent colour(Parts of the BMP are opague, but not all)?
CMemDC is probably the keyword you should use to find something relevant on CodeProject about that.
Handling transparent colors can be achieved in many ways. One I usually take is by creating a CImageList since this class allows to set a key color to a bitmap.
Back to real work : D-27.
|
|
|
|
|
Thanks
.S.Rod. wrote:
Locked Ghost wrote:
How can I create a window that stays on top of the other child windows like a floating toolbar?
I won't show you how to do this. That's an annoying habit.
Why is that?
|
|
|
|
|
People ask this question three times a week
There are many articles here on CP how to describe it. You might want to take a look at "Dialog box tricks" by Nishant S
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Locked Ghost wrote:
Why is that?
A window should come on top only if explicitely asked by the user. Otherwise, it's like a annoying popup on the web : it may interrupt you while you were entering text somewhere, or clicking somewhere.
That's basic UI guidelines. I don't think further explanations are required.
Back to real work : D-27.
|
|
|
|
|