|
Simon Steele wrote:
I can send anyone who's interested the project files.
Send me the project please.
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
If you view depends on Excel you can see that Excel exports functions.
Both Exes and DLLs are written in the PE format. The only difference between them is their entry point that either makes them standalone execuatable or not.
So you will be able to load and EXE and map function addresses in that EXE at runtime just like it was a DLL.
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!
|
|
|
|
|
Paul Watt (kilowatt) wrote:
So you will be able to load and EXE and map function addresses in that EXE at runtime just like it was a DLL.
Faking the OS by using an EXE as if it was a DLL leads you to unexpected problems. Allright, the vtable is exported and reflected by quickview or other PE viewers. Allright, you may even call a method on it. And if you are lucky, this will even work.
Indeed, The process boundary and load context enabled by a standard exe launch is totally different than with a DLL (loaded in the same address space). In other words, the DLL has no context at all.
You'll meet soon a guy called time chkesp.c complaining about such a use.
In addition, the executable must be designed to be able to respond to your calls. Don't forget that once a process is launched, it is doing something, and is not necessarily able to respond outside calls. That's one of the benefits of using COM instead.
The process life cycle raises a bunch of other troubles, but I let you discover them.
Good luck!
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
You are a lot better off making your EXE a local COM server, than trying to call in to it as if it were a DLL. COM handles all of the process/context issues for you, and you don't have to worry about calling differences between DLL's, and all that stuff.
By the way: it's easy to make an existing application act as a COM server as well as continue its normal activity.
Gary R. Wheeler
|
|
|
|
|
I use AVIStreamGetFrame() to get the frame data, then use
the data to write an BMP file, but i find the BMP file is
not correct, PLS refers to the attached file, you can see
the file, the circle is split, but in fact the circle is
not split and should in the center. But i use DrawDibDraw
to write the frame to screen, the result is right.
I do not know why, PLS help me.
Welcome any suggestion.
PS:
PAVISTREAM m_pVideoStreams [MAX_VIDEO_STREAMS];
AVISTREAMINFO avis;
LONG lEnd, lEndTime, l;
LONG lPos;
BYTE m_byteFormat [1024];
AVIStreamInfo(m_pVideoStreams[i], &avis, sizeof
(AVISTREAMINFO));
FIXCC(avis.fccHandler);
FIXCC(avis.fccType);
l = sizeof(m_byteFormat);
AVIStreamReadFormat(m_pVideoStreams[i],0, &m_byteFormat,
&l);
lPos = AVIStreamTimeToSample(m_pVideoStreams[i], lTime);
AVIStreamSampleSize(m_pVideoStreams[i], lPos, &lSize);
lpbi = (LPBITMAPINFOHEADER)m_byteFormat;
FIXCC(lpbi->biCompression);
// Which frame belongs at this time?
lEndTime = AVIStreamEndTime(m_pVideoStreams[i]);
if (lTime <= lEndTime)
lFrame = AVIStreamTimeToSample(m_pVideoStreams[i],
lTime);
else
{ // we've scrolled past the end of this stream
lEnd = AVIStreamEnd(m_pVideoStreams[i]);
lFrame = lEnd + AVIStreamTimeToSample
(m_pVideoStreams[i], lTime - lEndTime);
}
lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(m_pVideoPGF
[i], m_lFrame);
//then accordint to the lpbi to draw in the screen and
write to an BMP file
|
|
|
|
|
Suppose many windows are open on your desktop. As such only one window is active which is in the front and has the current input focus. I call it active window while the others as inactive windows. Right !!!!
I want to create simple dialog box application. But i want my dialog box to appear as an "inactive" form, i.e when i run my application from Visual Studio, the dialog box appears in the back of Visual Studio Window and Visual studio Window not lose its focus. How can i do so ???
|
|
|
|
|
ShahShehpuri wrote:
Suppose many windows are open on your desktop. As such only one window is active which is in the front and has the current input focus. I call it active window while the others as inactive windows. Right !!!!
AFAIK
ShahShehpuri wrote:
How can i do so ???
ShowWindow(SW_SHOWNA)
"MSDN: SW_SHOWNA Displays the window in its current state. The window that is currently active remains active"
HTH
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
ShowWindow(SW_SHOWNA)
But at which place in dialog Application, i use this function ??? I used it in OnInitDialog(), but it didn't worked ???
|
|
|
|
|
Hi,
I got a handle to a window, and want got a pointer to the windows object for further manipulation, how to do then? Example is welcomed.
Thanks
Extreme programming. Do the No.1
|
|
|
|
|
you mean you want a CWnd from an HWND ? CWnd::Attach and CWnd::FromHandle might help.
-c
Support regime change. Vote.
|
|
|
|
|
and how to use them, show me an example, plz.
Extreme programming. Do the No.1
|
|
|
|
|
Look the code, it doesn't work
<br />
int CALLBACK MonitorCallback(HGLOBAL hBuf, int nLen, LPARAM lParam)<br />
{<br />
LPBYTE lpBuf = (LPBYTE)::GlobalLock((HGLOBAL)hBuf);<br />
if(!lpBuf)<br />
return 1;<br />
<br />
CString str=HexDump(lpBuf,nLen);<br />
CEdit Edit;<br />
<br />
Edit.Attach((HWND)lParam);<br />
CEdit *pEdit=(CEdit*)Edit.FromHandle((HWND)lParam);<br />
pEdit->SetWindowText(str);<br />
<br />
return 0;<br />
<br />
}
what's wrong???
Thanks in advance
Extreme programming. Do the No.1
|
|
|
|
|
|
CWnd* pEdit = CWnd::FromHandle ( (HWND) lParam );
pEdit->SetWindowText ( str ); Although you don't need to muck about with CWnd s for such a simple task. Using the APIs would be simpler:
SetWindowText ( (HWND) lParam, str );
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
This time I use a CListCtrl to accept data, this ListCtrl has three Columns for "No.", "Value" and "Time". its works well in my dialog, but after use Callback function to transfer ListCtrl Hanlde, the 2 subItems can't accept data, why?
Extreme programming. Do the No.1
|
|
|
|
|
Hello All,
Is there anymore than this that I need to do so that the font used to print on a CStatic control is changed?
CFont font;
font.CreatePointFont (80, _T("Times New Roman"));
CWnd* pPrices = GetDlgItem (STATIC_SHOW_ALL);
pPrices->SetFont (&font, TRUE); STATIC_SHOW_ALL is the ID of my static control. When I write on the control now (using a member var that's attached to it) it changes the font from the default the dialog is using but not to the font I set it to. Any help is as always much appreciated.
- monrobot13
|
|
|
|
|
|
Works like a dream now. Thanks much.
- monrobot13
|
|
|
|
|
When i priting,I always get a left and top margin,like printing a pixel on the left top corner:pDC->Pixel(0,0,RGB(0,0,0))
the result on the paper always get an offset.
I can get the physical offset of the printer,but how to change the offset,I tried SetViewportOrg,nothing changed!
any help?
int x = pDC->GetDeviceCaps(PHYSICALOFFSETX);
int y = pDC->GetDeviceCaps( PHYSICALOFFSETY);
pDC->SetViewportOrg (-x,-y);
|
|
|
|
|
Most ink jet and laser printers can not print from edge to edge of the paper. They can usually print to within 0.25 inches of the edge. The limit may be less, depending upon which edge and the type of printer.
Gary R. Wheeler
|
|
|
|
|
2 part question. How do you include a dll in an app that I can call from a seperate exe. Like the way you call the excel.exe file but it is used as a dll. Thanks for your help.
Darroll
Not one person lives in the present. Only the past. I can prove it.
|
|
|
|
|
Hi,
where can i find the information on Design pattern ?
thanks
Extreme programming. Do the No.1
|
|
|
|
|
In any books you might find on www.amazon.com that have the words 'design pattern' in them. I don't know of any websites really. safari.oreilly.com has some, and a 14 day free trial.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Microsoft Press has a book on Design Pattern of Visual Basic programming call Microsoft Visual Basic Design Patterns. I remember they also have one for software developement, but I can't remember the name of it.
If you want a very high level overview of the software life cycle, many university uses R S Pressman, Software Engineering: A Practioner's Approach, 5th edition, McGraw-Hill, 2000 It's a pretty good book, but it won't tell you in technical details what is good code pratice and what is not. If you find a good book with good code examples in a large enough project, let me know!
http://LessExpense.tripod.com
|
|
|
|
|
Ward Cunningham's WIKI site at : http://www.wiki.org[^]
has design pattern info. Or you could invest in the book written by the 'Gang of Four', Eric Gamma et al, mentioned somewhere within the Wiki - do a wiki search and you should find more details
Cheers, Garth
|
|
|
|