|
That did help, thanks a log. I went ahead and derived from CStringList and that took care of my preprocessor problem.
Mike Ellertson
|
|
|
|
|
I cured the problem and I have no idea why. Perhaps it has to do with datatype and casting? Here's what I did:
void GraphicsWindowsForm::PaintHandler(Object* sender, PaintEventArgs* e)
{
...
...
System::Drawing::Rectangle rcRect = get_ClientRectangle();
rcRect.Inflate(-10,-10);
//Make sure an integer is an integer (yeah, it doesn't make sense but it worked for some reason)
int nWidth=rcRect.Width;
int nHeight=rcRect.Height;
System::Drawing::Graphics * Gr = e->get_Graphics();
System::Drawing::Bitmap* bmp = new System::Drawing::Bitmap(nWidth,nHeight,Gr); //contructor stop bitching about delegates after changing rcRect.Width to nWidth..>!???!#$_)*()#4
... more code ...
...
}
norm
|
|
|
|
|
Shouldn't you be in the Managed C++ forum instead of the VC++ one???
|
|
|
|
|
I can screen capture a window surface. But not a video surface being played on Media Player. I get only the frame of the Media Player and a "black" surface where the current video frame should be.
This "black" surface is seeming like a "transparent" layer (I am guessing here) upon which the video frames are rendered. I am guessing it is the DirectShow surface.
How can I capture the video frame?
|
|
|
|
|
Some of these may help
1. Right click on your desktop into Display Properies, Settings, Advanced disable video overlay on your video card.
2. Run Dxdiag.exe go to the display page and disable Direct Draw hardware acceleration
|
|
|
|
|
Isn't there another way without changing to software emulation?
|
|
|
|
|
Nope, no ways
Try also to make sure the bitmap displayed have the same format than the screen (if you grab a 16-bits/peixel picture and try to display it on a 32-bits/pixel screen, you'll get a blank/black screen).
If it is a code you own and thus you can modify, you should convert the grabbed picture to the screen format before display...
Kochise
In Cod we trust !
|
|
|
|
|
|
is there anyway to set the hardware acceleration in c++?
|
|
|
|
|
How to capture the file name while doing saving process of a file
|
|
|
|
|
Just trying to create a bitmap, but I'm getting some weird error:
Here's the code:
void GraphicsWindowsForm::PaintHandler(Object* sender, PaintEventArgs* e)
{
...
...
System::Drawing::Rectangle rcRect = get_ClientRectangle();
rcRect.Inflate(-10,-10);
//ERROR HERE! C3364!
System::Drawing::Bitmap* bmp =
new System::Drawing::Bitmap( (int) rcRect.Width, (int) rcRect.Height, (Graphics*) e->get_Graphics() );
Graphics* bmpGr = Graphics::FromImage(bmp);
bmpGr->FillRectangle(
new SolidBrush(System::Drawing::Color::White),
get_ClientRectangle()
);
... more code ...
...
}
Here's the error:
c:\Documents and Settings\Norman\My Documents\Visual Studio Projects\GDIplusApp\GDIplusApp.cpp(53): error C3364: 'System::EventHandler' : invalid second argument for delegate constructor; needs to be a pointer to a member function
Thanks!
norm
|
|
|
|
|
I've been programming on the Macintosh for many many years, and now I would like to write some Windows applications. I don't know where to start, though I do have a Windows laptop and Visual C++ .NET.
I'm interested in doing graphics and image processing applications, so I'd like to be able to read, write and process images of various sorts, use dialogs and menus, and respond to clicking and dragging in the content portion of windows.
Where can I find a sample application for these kinds of tasks?
Ken Turkowski
Engineer/Scientist
Independent Consultant Industrial Grade Software
Computer Graphics 2D 3D Immersive Imagery
Photo-mosaicing Panoramas Computer Vision
Applied Mathematics Numerical Analysis Optimization
|
|
|
|
|
DirectShow which is a part of DirectX might be what you're after. It offers the ability to write 'transform filters' to operate on a media sample, which might be video / audio or something else. The learning overhead for DirectShow is quite high (in my opinion, but I'm only a university student ).
It helps if you already have a good grasp of COM, and are prepared to sift through a fair bit of documentation, a muddle of macros (at times) and the sample applications which come with the DirectX API, available from Microsoft. The sample apps are probably the only viable place to start, you might find that you don't need to change too much code to get you running quite quickly. The samples are installed to C:\DXSDK\Samples\C++\DirectShow on my machine after a default install.
DirectShow includes GraphEdit a tool for combining transform filters into 'filter graphs' (source -> filter -> renderer pipelines). If you want to get going fast, copy and paste (changing the GUID's of course) from one of the sample filters, modifying the transform method and look at the output in GraphEdit. You can get the dialogs end of the application running (to a certain extent) by using property sheets. I found one of the best sources on how to set up custom property sheets that can be called from GraphEdit was in the OpenCV (Open Computer Vision) library (available on Source Forge) which contains a 'CamShift' DirectShow image processing filter, amongst heaps of other cool stuff.
Getting up and running in your own application can be a bit more challenging, one place to start is with the SampleGrabber filter and/or the playcap capture sample. The benefit of going this way allows you all the flexibility of choosing your windowing library (WTL, MFC or raw Win32) for all the really complex GUI stuff.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hello all
I would like to retrieve LOCAL AREA NETWORK's ipaddress range(starting to ending address) programmatically. Is there any way to do it. Currently I'm using vc++(MFC) to code my application. if you know how to do it, please help me.
Many thanks for your help.
Hari.
|
|
|
|
|
take ip address of your machine, mask it with the subnet mask and you'll have the address of the subnet, then you can set all masked-out bits to 1 and you'll get the broadcast address for the subnet. Everything between is addresses that can be used inside the same subnet where the computer is located.
But this works only for one subnet, I don't know any universal method to get all addresses in the LAN if it consists of several subnets (except obvious 'contact your administrator')
Simplistic example:
IP addr: 192.168.0.1
MASK: 255.255.255.0
subnet addr: 192.168.0.0
broadcast.: 192.168.0.255
addr. 192.168.0.1 - 192.168.0.254 are available for use in this net segment
|
|
|
|
|
I just created an MFC class that will be useful for most of my applications. There are two files: Passport.cpp and Passport.h. Where can I place these files so that they an be automatically loaded by different ptojects.
The main problem is with the CPP source file. I have a folder for my H header files. I guess there should be a folder for the CPP source file too. While I can include the header file in the project, how is the associated CPP file loaded automatically?
Isaac Inyang
Ansyl Technologies
|
|
|
|
|
Hi
Add the cpp-file (or both h and cpp) to your project.
Regards
Frank
|
|
|
|
|
If you plan not to change the cpp file then you can compile it and create a lib file out of it. After that, if you have a location where you place your header files, you need to include it in the options by doing the following:
1. Click on Tools->Options
2. Click on the tab Directories
3. Where it says "Show directories for:" select Include files.
4. Click on the first button (it has a square) that is next to the field Directories: (or just double click on the field).
5. Add the headers' file location.
The same thing can be done for the lib files. You also have to add the lib file in the linker's options.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Hello ,
Iam in search of a vc++/WIn API code or interface which gets the list of pluggins installed for IE in the system
Cause is my effort;
Effect is God's effort
|
|
|
|
|
Hi. How do you access an xml file in C++, as well as write it and read from it.
"To teach is to learn twice"
|
|
|
|
|
|
I've programed a Hello world Dialog based app using MFC.I just a button and add MessageBox("Hello!") code,and I use Rational Purify to find the memory leaks,I always find a lot.
Why?
Thank you!
Let's roll!
|
|
|
|
|
Not every leak Purify/BC detects is the true leak.
Some like: "NoTrack" ( or "NoMemoryTrack"!? ) and SetEnv, delayLoad has to do with MFC structure, others leaks inside CryptoApis, etc has to do with crappy MS coding.
|
|
|
|
|
In addition to what Brian said, some leaks are due to improper termination. Many termination leaks are due to how the leak detecting program monitors the DLL. In some cases, they do not, or cannot, check memory in the proper spot. Regardless, these are of no real concern.
I haven't used Purify, but they should have a filter file for each compiler and library used. Be aware that on a few occasions these programs will do a false detection. I have perfectly legitimate code that totally "stumps" BoundsChecker as well as other programs.
The leaks to be concerned about are those that happen while the program is running.
|
|
|
|
|
Any clues on how to trap the standard Window | Close All command? I need to close a number of modeless dialogs before continuing with the standard operation, which closes all open views.
I suppose I could just define my own IDC_WINDOW_CLOSE_ALL command, but it seems like it's a pain to inject this menu item into the standard Windows popup.
Thanks,
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|