|
You can't, it's hard-coded, it all depends on the wish of the coder who added to "..." or not...
Kochise
PS : Total Commander is great, I use it anywhere, home, office, ...
In Cod we trust !
|
|
|
|
|
I want a modal dialog box to perform some automatic tasks after it is shown on the screen. In that tasks there can also appear a messagebox, so if I use the Windows Message OnSetFocus(), the messagebox will keep coming up, because every time the user clicks OK on the message box, the dialog gets his focus. Is there a way to achieve this?
Thnxx
|
|
|
|
|
harmendejong wrote:
I want a modal dialog box to perform some automatic tasks after it is shown on the screen.
Near the end of OnInitDialog() , just post a message to the dialog.
|
|
|
|
|
At the end of your OnInitDialog function, post a custom message to your dialog using PostMessage. The code in your handler will be executed after your dialog is displayed.
#define WMU_MYCUSTOMMESSAGE WM_APP + 1
...
ON_MESSAGE(WMU_MYCUSTOMMESSAGE, OnMyCustomMessage)
...
BOOL CMyDialog::OnInitDialog()
{
...
PostMessage (WMU_MYCUSTOMMESSAGE, 0, 0);
return FALSE;
}
...
void CMyDialog::OnMyCustomMessage(LPARAM, WPARAM)
{
}
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi, guys:
First time for me posting here, forgive my rudeness or other unwelcomed.
I'm repairing a software with several dll's. My duty is to cut down any dll and import anything in them into main source code.
Are there any articles on this topic or some advice ?
TIA
-gusd
|
|
|
|
|
I've done this several times and the most effective way has been to convert the DLLs into libraries.
First, get a list of all the files in the project (it's not unusual to have some files in the directory which aren't actually in the project.)
Second, remove the DllInit function. Usually you don't need to replace it with anything since it doesn't do anything. If it does, you can often create a small private class and instantiate it globally. If that won't work, simply add Init() and DeInit() functions then call them from the main program in the proper manner and sequence.
DO NOT get fancy at this point. It's a huge temptation, but one you must resist.
Third, fix up the headers. You don't need the "dllimport"/"dllexport", etc stuff. (Nor do you need the .def file.) Add #pragma comment(lib, "put library name here.lib") to the header.
Fourth. Ensure the libraries are subprojects of the master project. Add the subprojects to the master. Set the dependencies and paths and you're off!
Fifth, oh, and go through the main project to ensure you aren't "manually" loading the DLLs or accessing them through a pointer or other such strangeness.
|
|
|
|
|
Hi all
I create internal control in my ATL project and i want
call it IpersistStreamInitImpl::Load(LPSTREAM pStream) method immediatly but how i can recognize what pStream used this control????
Thanks
|
|
|
|
|
I'm trying to serialize a class that I've derived from CArray. It's just an array of CString objects:
class CFormList : public CArray<CString, CString&> {
DECLARE_SERIAL(CFormList);
...
}
Then I include the IMPLEMENT_SERIAL macro:
IMPLEMENT_SERIAL(CFormList, CArray, 1);
When I compile I'm getting this error:
error C2955: 'CArray' : use of class template requires template argument list
I've also tried changing the IMPLEMENT_SERIAL line to this:
IMPLEMENT_SERIAL( CFormList, CArray<CString, CString&> );
But that give me this compile error:
warning C4002: too many actual parameters for macro 'IMPLEMENT_SERIAL'
error C2039: 'classCArray' : is not a member of 'CString'
I'm totally at a loss for why I'm getting these errors . Has anyone else seen this?
Thanks,
Mike Ellertson
|
|
|
|
|
It's a limitation of the macro expansion capability of the preprocessor. The preprocessor splits the parameters where it sees commas. It does not parse its parameters at all. Basically, what it means is that the only way you can do this is to get the MFC source definitions for IMPLEMENT_SERIAL() and code it directly, rather than using the macro.
It's a pain in the neck, but the only way, I'm afraid.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
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
|
|
|
|