|
Hi there!
I use a lot the "dependents" utility that vstudio offers. I'd like to have a funcionality in the About box, which wold list all the dll dependencies that an .exe (the current one) uses.
Does any one have a sugestion on how to do it, or where to look for info?
Many thanx in advance.
António Carvalho
|
|
|
|
|
you can do it reading the pe image header of the executable. The dependencies are in the import section of this header.
You can find documentation and source code here: http://www.msdn.microsoft.com/msdnmag/issues/02/02/PE/
I hope this can help you :P
|
|
|
|
|
|
Hi. I am trying to create a very basic basic non doc/view app that loads strings from a file into a list control. The file looks something like this:
2
Hello
Hello
I am trying to use DOS file functions to interpret the int on the top line to figure out how many strings it needs to load. The problem is, I am not very experienced with DOS file functions and wonder if a feat like this is even possible with DOS file functions. Is there a way?
-- Steve
|
|
|
|
|
Yep, just use the standard C stdio functions, open the file, read it into a buffer, and then parse the integer using atoi. If you get stuck, look on the net for examples - every C programming book should go through the above!
|
|
|
|
|
Is there anyway to use the fscanf function?
-- Steve
|
|
|
|
|
FILE *fp= fopen(file, "r");
int i;
if (fscanf(fp, "%d", &i)!=1)
{
}
...
fclose(fp);
A | B - it's not a choice.
|
|
|
|
|
I was just wondering what is used more in the world of C++ MFC or Win32 apps? I know it seems like most games that are made are in Win32 however what about MFC is it used very much and is there jobs that acutally need people that can do MFC? If so where could you get a job doing MFC?
- LiquidKnight
|
|
|
|
|
LiquidKnight wrote:
If so where could you get a job doing MFC?
5 years ago, they were everywhere. now, you need much more than just MFC. every job listing i see requires ASP, Javascript, ColdFusion as well as SQL Server, MFC and VB.
-c
A | B - it's not a choice.
|
|
|
|
|
i think that wenn your able to programm win32 the step to mfc is no problem, because win32 is closer to the api. its like programming basic when your already able to programm c++.
|
|
|
|
|
Hello - I'm an old timer with the Win32 API and MFC development environments. Have been writing code for sale in the windows environments for many years. Now thinking about the .NET C# environment and have a concern. So far as I can tell code developed within the .NET environment can ONLY be executed within a .NET environment, i.e., everyone you sell to must have installed a .NET environment. Is this in fact true?
|
|
|
|
|
What you use to write the code doesn't matter. But any managed code (that means C#, VB.NET, C++ using managed extensions, or any *.NET language to come) requires the .NET runtime (that's the phat 20 MB installer) to run.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
You're absolutely right, at least with respect to code written in C#. VS.NET maintains the possibility of writing C++ without requiring you to use the CLR.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a ActiveX control originally written with VC5 that I decided to migrate this weekend. Something fun to do while your home sick, right
It has a OpenGL "window" in it and all migrated fine. Just a few depreciated registry calls and changing a couple Exception throws.
EXCEPT: When the control closes I get an unhandled exception (same location everytime.) when I call
wglDeleteContext(m_hRC)
in the OnDestroy Function. The create is called in the OnCreateFunction
wglCreateContext(m_pCDC->GetSafeHdc());
The value is allways 0x00010000
I have not found much documentation for these calls and it has been some time since I wrote this and obviously not kept up with changes. I find the MSDN lacking here (or at least not indexed well.) The only issue I have found is if a multi thread state exists and there should only be this one occurance.
All else is fine. Just can not close it!
I would appreciate any pointers to the documentation that I am missing.
Thanks
"I will find a new sig someday."
|
|
|
|
|
My advice would be to force the context to not be the current one. A call to wglMakeCurrent with NULL for both parameters should do this. I realize MSDN says that wglDeleteContext will do this for you, but there is no harm in been safe.
Also, like you mention, you should double check that each instance of your control has its own GL context, and that this context is not been freed by another instance.
If none of that helps, take look at the return value of GetLastError and see if this gives you a hint as to what's going awry.
|
|
|
|
|
Just want to say thanks for the suggestions. I had been calling wglMakeCurrent with NULL.
I loaded one of the MSDN samples and it acted exaclty the same.
I did a test where I create the context and then deleted it on the next line. Same results. I am going to reload the SDK installation and see if that changes anything. The issue is only on the machine with VS.NET installed (and July 2002 SDK.) The system with VS6 (and Nov 2001 SDK) runs fine.
"I will find a new sig someday."
|
|
|
|
|
Hi,
i've tried to initialize DirectDraw and to create a Primary Surface with an attached Back Buffer. The initialisation-function fails and I've no idea why. The CreateSurface-Function fails. I've tried to retrieve the error code returned by it but I've found no matching error defined in ddraw.h)
I've removed DDSCL_EXCLUSIVE for debugging purposes. It's hard to debug a program with exclusive access to video memory and input-devices
Thanks for you help.
[code]
BOOL DXGraph::InitGraphicsSystem(HWND hWnd)
{
DDSURFACEDESC2 ddPriSurf;
DDSCAPS2 ddCaps;
BOOL bSuccess = FALSE;
//Globales DirectDraw Objekt erzeugen
if (FAILED(DirectDrawCreateEx(NULL, (LPVOID*)&lpDD7, IID_IDirectDraw7, NULL)))
{
return FALSE;
}
//Kooperationsebene festlegen
if (FAILED(lpDD7->SetCooperativeLevel(hWnd, DDSCL_NORMAL | DDSCL_FULLSCREEN | /*DDSCL_EXCLUSIVE | */DDSCL_ALLOWREBOOT)))
{
lpDD7->Release();
return FALSE;
}
/* if (FAILED(lpDD7->SetDisplayMode(1024, 768, 16, NULL, NULL)))
{
lpDD7->Release();
return FALSE;
}
*/
//Primäre Oberfläche erzeugen
ZeroMemory(&ddPriSurf, sizeof(ddPriSurf));
ddPriSurf.dwSize = sizeof(ddPriSurf);
ddPriSurf.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
ddPriSurf.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_VIDEOMEMORY | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
ddPriSurf.dwBackBufferCount = 1;
if (FAILED(lpDD7->CreateSurface(&ddPriSurf, &lpDDSPrimary, NULL)))
{
lpDD7->Release();
return FALSE;
}
//BackBuffer-Adresse abfragen
ddCaps.dwCaps = DDSCAPS_BACKBUFFER;
if (FAILED(lpDDSPrimary->GetAttachedSurface(&ddCaps, &lpDDSBackBuffer)))
{
lpDDSPrimary->Release();
lpDD7->Release();
return FALSE;
}
return TRUE;
}
[/code]
|
|
|
|
|
Problem:
Compuholic wrote:
if (FAILED(lpDD7->SetCooperativeLevel(hWnd, DDSCL_NORMAL | DDSCL_FULLSCREEN | /*DDSCL_EXCLUSIVE | */DDSCL_ALLOWREBOOT)))
DDSCL_NORMAL and DDSCL_FULLSCREEN are mutually exclusive. You cannot use them together. If you want a Fullscreen application use DDSCL_FULLSCREEN, and if you are going to run your app in a window use DDCSL_NORMAL.
Other than that things look ok to me. If you would like an example of some DirectDraw code, I have written a simple framework that I use in a Tetris game that I wrote and posted here on code project. You are welcome to check that out: Tetris[^]
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks, you are right. I just checked the documentation on MSDN. But i'm wondering why SetCooperativeLevel succeded if it was just an invalid combination of flags.
Another Problem persists:
DDSCL_FULLSCREEN has to be used with DDSCL_EXCLUSIVE. Is there a way to debug such an application?
If I use DDSCL_NORMAL the CreateSurface function still fails. Is it possible that Double Buffering can't be done in a normal windowed application. I need some way to debug it
|
|
|
|
|
Compuholic wrote:
If I use DDSCL_NORMAL the CreateSurface function still fails. Is it possible that Double Buffering can't be done in a normal windowed application. I need some way to debug it
I am sorry, I didnt even think about that. You cannot use DirectDraws backbuffer support to do page flipping. You will need to do your own bitblt to the screen from the backbuffer.
Also, there are two ways to debug a full screen app, and neither one of them are available to a normal setup.
You can either use a Dual Monitor system, which is what I use.
Or you can use a second machine networked to the first machine and do remote debugging.
The Tetris Game that I wrote supports both modes if you want to look at that.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Im relatively new to MFC and Im trying to implement an automagically sorting list control (you know the one, click on the column header, and it sorts itself, etc), im fairly sure ive got it all figured, but i get the error;
'GetListCtrl' : undeclared identifier
I always thought, as does msdn that GetListCtrl is a function of afxcview.h, yet despite me including this file, i still get the message, is there a lib i need to link or something ?
|
|
|
|
|
hi all ,
hope u can help me with this brain-teasing (?) problem.
i have two classes:
class Surface {...},<br />
class Extent : public Surface {...},
let pMyPtr be a DWORD_PTR which can store a pointer to either an Extent or a Surface, ie.
Extent *myExtent=new Extent();<br />
Surface *mySurface=new Surface();<br />
<br />
pMyPtr=(DWORD_PTR)myExtent, or<br />
pMyPtr=(DWORD_PTR)mySurface,
say for example that at a particular time it is not known what DWORD_PTR actually points to - it could either be an Extent object or a Surface object.
Is it possible to determine this? I need some sort of function as shown below...
if(pMyPtr points to an instance of the extent class)<br />
AfxMessageBox "this is an extent"<br />
else<br />
AfxMessageBox "this is a surface"
hope u can help cos i am absolutely boggled by it!
thanks,
Paul.
|
|
|
|
|
It can be done if Surface has at least one virtual function:
if(dynamic_cast<Extent*>(reinterpret_cast<Surface*>(pMyPtr))){
}
else{
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Another option is to investigate RTTI (Run Time Type Information). I haven't used it in years, but it's basic premise is to do what you want.
Joel Lucsy
|
|
|
|
|
How can i catch the LBUTTONUP in the dropdownpart of a Combobox?
What i would like to do is to know which item that has been clicked
in the list. And the only thing that i can think of is catching
the mousebutton and caluculate which item the user has clicked.
Or is there another way?
|
|
|
|