|
First, the division is to be made through SplitterView, the left side as CTreeView and the right side as CListCtrl or CListView in report mode
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Does anyone know where the demo and zip files from this google cache are ? The links off of the cache are broken.
http://64.233.169.104/search?q=cache:_hGEheYkd6YJ:www.codeproject.com/debug/LibView.asp+view+.lib+function&hl=en&ct=clnk&cd=1&gl=us&client=firefox-a[^]
On the google cache html there is some code, but I'd prefer to download the original demo, since I'm not entirely sure how much code is missing from the excerpt.
The motive:
My task is to make arbitrary c++ source code trees available to .NET. I created a program to scan the header files and create a SWIG interface file to input into SWIG which generates pinvoke signatures (in a large C++ file (150000 lines)) for the libraries. The problem is, sometimes the header files contain signatures that didn't get implemented in the libraries and therefore I get a bunch of linker errors.
So in order to workaround this, I would like to scan the .lib files for function definitions and then compare against header files in order to determine what's been implemented (without having to do it manually - these source code trees are huge).
Thanks for your help.
|
|
|
|
|
|
Im posting this here in the hopes of a quicker answer (as opposed to the Graphics forum).
I've been playing around with DirectX in C# for quite some time now with success. All the tutorials in the DXSDK9.0 run fine for C# and VB.Net.
I want to learn how to use DirectX in C++, but when I try and run any C++ example I get the below errors...
1. Error LNK2019: unresolved external symbol _Direct3DCreate@4 referenced in function “long_cdecl InitD3D(struct HWND__*)”(?InitD3D@@YAJPAUHHWD__@@@Z)
2. Fatal error LNK1120: 1 unresolved externals
These errors were generated when I tryed to run the very first tutorial (initialise a DirectX device).
I figure there maybe a header file I need to move somewhere.
Has anyone run into this problem before, and/or knows how I could fix it?
Kind Regards,
Mark.
|
|
|
|
|
MarkBrock wrote: I figure there maybe a header file I need to move somewhere.
Those are linker errors, not compiler errors, so they don't involve missing headers.
You need to link to the appropriate DirectX import libraries.
You can add them to your project, add them to the project's Linker/Input settings,
or add something like the following lines to a source file:
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#pragma comment(lib, "dxerr9.lib")
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ok, Thanks Mark, i'll try that when I get home from work.
It's just interesting that these error's were appearing in the tutorials included within the DirectX SDK itself. I know for certain that the link to the 'd3d9.lib' was in the code, but i'll try the other two and see what happens.
Thanks.
Mark.
|
|
|
|
|
Hi, I'm getting the following problem.
error C2065: 'string' : undeclared identifier
but I have included "#include <string>" at the beginning of the cpp file. when I compile the code, compiler tells me this error on the following code:
string strPath;
any idea? thanks a lot!
|
|
|
|
|
and I have added "using namespace std;" after "#include <string>". still not working and it tells me that 'std' : does not exist or is not a namespace.
|
|
|
|
|
found why. I put the "#include <string>" before #include "stdafx.h". after I updated it. it's working.
|
|
|
|
|
When you are posting #includes... put a space between the < and the header itself. If not... the site will try to get it as a HTML tag and the line will not full visible.
#include < header.h > //A space between brackets and header
#include //Without spaces
Or click on "Ignore HTML tags in this message (good for code snippets)" below your message
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
In addition to NELEKs suggestions, you can wrap your code-snippets with the pre-Tag, or use the < >
You find both below the edit-field when writing the message.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
hello , i am trying to write a bmp to file , sometimes works sometimes it doesn't work properly . i am making recorder for ymsg.
i tried to snapshot the whole screen and look what happens when the webcam window is present in the snapshot , the image is clear before the webcam window , why ? i don't have a clue. and CreateDIBSection returns ERROR_NOT_ENOUGH_MEMORY. and after all this i've written a tester to see when CreateDIBSection returns ERROR_NOT_ENOUGH_MEMORY.
i am thinking that this problem may have 2 issues , 1. my code is wrong , 2. bug in windows and of course this api function.
here is the sample snapshot image:
http://www.rohitab.com/discuss/index.php?act=attach&type=post&id=1658[^]
tester to see when CreateDIBSection return an error
#include <stdio.h>
#include <windows.h>
DWORD error=0;
BOOL test(int nWidth, int nHeight)
{
HDC memDC = CreateCompatibleDC(NULL);
BITMAPINFO i;
ZeroMemory(&i.bmiHeader, sizeof(BITMAPINFOHEADER) );
int extrabytes = (4 - (nWidth * 3) % 4) % 4;
i.bmiHeader.biWidth = nWidth;
i.bmiHeader.biHeight = nHeight;
i.bmiHeader.biPlanes = 1;
i.bmiHeader.biBitCount = 24;
i.bmiHeader.biSizeImage = (nWidth * 3 + extrabytes) * nHeight;
i.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
i.bmiHeader.biClrUsed = 0;
i.bmiHeader.biClrImportant = 0;
VOID *pvBits;
error=0;
HBITMAP h = CreateDIBSection(memDC, &i, DIB_RGB_COLORS, &pvBits, NULL, 0);
error=GetLastError();
if (h==NULL)
{
DeleteDC(memDC);
return 1;
}
DeleteObject(h);
DeleteDC(memDC);
return 0;
}
int main()
{
for (int k=1;k<100000;k++)
{
test(k,k);
printf("\n%u eror:%d", k,error);
}
return 0;
}
|
|
|
|
|
csmanul wrote: 1. my code is wrong , 2. bug in windows and of course this api function.
I Know the Sentiment, Contemplated this question for about 1000 times over the last 20 years. Always turned out to be Option 1 though, (Well, except for 2 occasions, which have now been fixed).
Without investigating in detail, your code constructs up to 100000 objects, and keeps the oject when successfull9 Deletes the DIB, but keeps the Object). When it finally fails, it complains. Seems quite natural to me that it behaves as it does! Why would you want 100000 empty DIBSections anyways.
Regards
Bram van Kampen
|
|
|
|
|
this is only a tester , even if i remove the call from for cycle not even one single call succeeds
|
|
|
|
|
You seem to use incredably large numbers for a tester, and, seeing it is a tester, did you try it with small numbers such as 1 and 2, or even 0?
It occurs to me that you simply exhausted all your resources, (which are large but not infinite)
Regards
Bram van Kampen
|
|
|
|
|
It's not mysterious at all. You have to have enough contiguous virtual address space available to allocate the bitmap. An image 100,000 x 100,000 pixels at 24 bit colour depth requires about 30GB. You've only got 2GB virtual address space to play with and large chunks of that are taken up by loaded DLLs and other memory allocations. If you really need an image this large you will have to come up with a way to do manage it in smaller pieces.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
not even an 1x1 image works , i've already told you , i remove the function call from for cycle and it doesn't succeed , i've also rebooted windows and made a single function call 1x1 image , failed with same error : not enough memory.
|
|
|
|
|
I am a amateur programmer trying to print the contents of a richedit control as suggested by the article "how to print the contents of a rich edit control" by Roger Allen.
Since my richedit control is in a modeless dialog (instead of a SDI) I am unable to simply use the control variable of the richedit control and the SetTargetDevice and FormatRange members of the RichEditCtrl class in MyView::OnPreparePrinting as suggested: "m_Control.FormatRange(NULL, FALSE)" etc.
I have tried a number of (crazy?) things to gain access to the dialog and richedit control that I want to print without success including:
CWnd* qDlg;
qDlg=CWnd::FindWindow(NULL,_T("Dialog Title"));
then trying to access the control etc. Perhaps (probably) this is something simple that I do not yet understand and hope that others can help me solve (and understand) this problem.
Any suggestions?
Thanks.
"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash
|
|
|
|
|
If you have code running in a view class then the modal dialog must be on another thread, right?
If so, you should be able to post app-defined messages to the dialog (instead of accessing the
control directly from a separate thread).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: If so, you should be able to post app-defined messages to the dialog (instead of accessing the
control directly from a separate thread).
It's such a shame there is no way to maintain the application session data in a single location we might call, oh I don't know... a model. That sort of design would negate having to tightly couple different user interface views being that their requirements could change in the future. Wait..... 
|
|
|
|
|
|
Mark Salsbery wrote: Am I the only one not getting email notifications when someone replies to my posts here?
No, I'm not getting any either.
"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
|
|
|
|
|
Thanks
I got a few today - yay!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Am I the only one not getting email notifications when someone replies to my posts here?
No, I never got this one. 
|
|
|
|
|
Thanks man. Did you get this one?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|