|
Just checked it, but the _AFXDLL wasn't in there... So I put it there, but that didn't seem to have any effects on the result (even after clean rebuilding a couple of times)...
I just created the project with the classwizard, selecting an extention DLL... And everything works, except this... It crashes on the destructor of the input string!
I found that putting LPCTSTR in the header, instead of CString, resolves the problem, but then I have to rewrite all my headers to use LPCTSTR... And what do I do with CString * then? I can't use LPCTSTR *, right?
Structured programming vs. chaotic mind boggling
|
|
|
|
|
> Just checked it, but the _AFXDLL wasn't in there...
So it wasn't the MFC Extension DLL. You should read MFC Technical Note 033 to learn more about this.
The rule of the thumb is: .exe *and* .dll must 'Use MFC in shared DLL' - you set this in 'General' pane of the 'Settings' window.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hmm, actually, I don't want to use 'MFC in Shared DLL', because a business policy of ours is to always use MFC in static DLL (to avoid MFC version conflicts)... BTW, it works if I put both projects in MFC as shared DLL.
If I use MFC in a static DLL, then what is the correct way to handle input-ouput string characters? My function does the following:
CString EatString(CString * pString, LPCSTR sInput);
pString gets completely mixed up inside the function, but somehow this keeps on leading to errors. I've tried the following things:
CString EatString(CString& pString, LPCSTR sInput);
CString EatString(CString * pString, LPCSTR sInput);
CString EatString(LPCSTR * pString, LPCSTR sInput);
none of these seem to work well.... What's the standard way, anyway?
Structured programming vs. chaotic mind boggling
|
|
|
|
|
> If I use MFC in a static DLL, then what is the correct
> way to handle input-ouput string characters?
There's no such thing as static DLL - 'D' in DLL means dynamic.
If you use static lib version of MFC, your .dll and .exe will have two different heaps. Memory allocated in .exe can't be freed in .dll and vice versa. Using CString::operator= may cause heap operations, and this is going to crash when MFC isn't shared. So the declaration for EatString should look more or less like this:
int EatString(char *szOutput, int cbOutput, const char *szInput);
You can return number of characters in szOutput after completing the operation. Or the error code, or whatever.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi,
If I have a class called CMyClass, I can create it both with:
CMyClass MyClass;
and
CMyClass *MyClass;
MyClass = new CMyClass;
If I have a template I can only get the first one to work like:
CMyTemplate<int> MyTemplate;
How do I create it with the 'new' operator?
TIA,
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
typedef CMyTemplate<int> CMyClass;
...
CMyClass *MyClass;
MyClass = new CMyClass;
--------------
"Criticism is often constructive because it makes you feel superior when you give it"
-- Dogbert
|
|
|
|
|
Thanks
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
You don't have to typedef. Just use this:
MyTemplate = new CMyTemplate<int>;
Works on VC6 SP5.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi all,
Here is a description of what I want to do:
Everyday I connect to a news web page that includes a number of news headlines each one of them being a link to the full story of the corresponding headline. I would like to develop an application that shall connect to this web once a day, download all headlines and the corresponding full stories and store them in a TEXT file that I will be able to later print and read. How can I do this using VC++?
Best Regards,
Christos
|
|
|
|
|
I would use the WinInet functions (functions that start with 'Internet*') to get the main page.
When you have the mainpage, you can find all the '<A href=.....>' where the URL to all the other sides is. Then use the same code, as you used to get the mainpage, to get the newspages, and save them to a local file...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I want to connect a file source filter,a avi splitter filter,a avi decompressor filter and a null renderer filter together to get the decode time of the total frames approximately,how can i connect them together??
|
|
|
|
|
use the utility program "graphedit.exe"
or read the dox about IGraphBuilder interface
LOX
|
|
|
|
|
Can I possibly draw figures on a Dialog Bar just like ordinary dialogs? If yes please do help me...!
Thanks ...
XNOR
|
|
|
|
|
Hi All ,
Can anyone tell me how to how to print in text mode .
|
|
|
|
|
You mean in MS-DOS mode and by C++ ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Actually i want to dev. Activex control or one of my Visual Basic project
which will allow the user to print in text mode .
|
|
|
|
|
You mean print to the printer ? If your mapping mode is MM_TEXT, you'll find everything is stupidly small, because an A4 page can have 4000x6000 'pixels' and so you get a postage stamp in the corner from your code created for 800 x 600. I set up a flag to make the code in OnPrepareDC/OnDraw/OnPaint not execute at all, because what I'm working on, I want a different result when I print ( a report ) anyhow. I do all my printing in OnPrint. If you *do* want the printing to be the same, the trick is to draw things relative to the DC size, which you get from GetDeviceCaps(dc, HORZRES) and VERTRES. Either way this is how I do my OnPRint, because I don't know ahead of time the DPI of the printer my users will be using. If you do this and draw with stretch blt, you'll be able to get your bitmaps to print OK. For text, you need to use a function that takes a DC and allows you to specify a font size in points. I think CFont has CreatePtFont, but I'm not sure ( it's something like that, but I learned about it here about a week ago ). In GDI+ you specify fonts in points automatically. When I moved to GDI+ I finally got all my fonts perfectly as I requested them, the same in my preview ( which I draw myself in a seperate function ) and my page. This is essentially because GDI+ IMHO behaves more as I expected it to in terms of the size of the font returned ( although it just may have been because I'd never discovered CreatePtFont ).
Sorry if this rambled a little - if you need more info, just ask. I can post some code to do it tomorrow at work if you're still stuck.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
How can I add activex component into my program at runtime? All helps talk
only about using Classwizard. But I can not find any help about
creating and using ActiveX component at runtime (like ActiveX tester tool)
I'm using Win2000 and Visual Studio 6 (C++)
|
|
|
|
|
I want to make Mapping Keyboard Resident program for POS system under Windows. Can you help me ... ?
|
|
|
|
|
Hi,
I am working with Disconnected Recordsets in a Component Function.I am passing the Recordset pointer from the Server to Client.There is no problem here.However , when I run the client for the First Time the Connection and Recordset objects are opened and I can get the records at the client(The server maintains these Records in MS Access DB).When I run the client for the second time and so on I get the COM error that "The application requested an operation which cannot be performed on an Object which is already open ".The error is due to Recordset opening at the start of the function .But, I am closing the REcordset at the client side.
How should I open and close the REcordset in that case to avoid this error ?
Thanx in advance for the help .
Regards,
yamini
|
|
|
|
|
How can I paint all the components of a CFrameWnd without using bitmaps?
|
|
|
|
|
DrawFrameControl() can be used to draw caption buttons, scollbar buttons etc. If that is what you meant.
--------------
"Criticism is often constructive because it makes you feel superior when you give it"
-- Dogbert
|
|
|
|
|
Someone please help me here.
|
|
|
|
|
I want to know the api to click or perform submit on HTML page using IWebBrowser interface.
I don't distinguish submit button or DHTML submit function.
If you know this way, please let me know.
Thank you
|
|
|
|
|
How do you add the current date on to the project using COleDateTime? And where do you add the code?
Nicole
|
|
|
|