|
Thanks Ernesto I totally agree. I use MFC because of its community and good references (books, websites...). I would like to learn VB too because It would improve my app dev workflow... I won't use WTL because I can't find anything interesting about it. No books, no references, it's not official so there's no support... The idea of developping an other MFC is a great idea but I talked with some guys about it and I don't think It can be a better library. It's supposed to be fast, small and flexible but actually It's a very very light MFC-like library and it lacks a lot of features. Moreover MFC7 is far better that MFC4.2... So I will stick with my good old MFC4.2 and Visual C++ 6 because It perfectly suits my need.
But I will buy COM ATL 3.0 to learn a few things about COM/ATL
Thanks again,
JM
Web: http://goa.ifrance.com
|
|
|
|
|
It is true that MFC7 vs WTL is a totally different question that MFC4.2 vs WTL. For the longest time, WTL was the only method of getting all the new fancy UI without hacking up MFC. But that isn't the case anymore.
One big difference between MFC and WTL is that WTL doesn't try to force a design framework on the programmer. WTL doesn't have this document concept already built in. If you want documents, that is a negative. If you don't want documents, it is a HUGE plus. Also, WTL provides a much simplified internal message system. This has good points and bad. Personally, I found MFC's message system to be overly complex in an attempt to be idiot proof.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
NOTE: Almost the same question it's in the VC++ forum...
I want the equivalent to the code below (used in order to create an instance of a XML doc):
hrInstanciarXMLDoc = this->m_pxmlDoc.CreateInstance(__uuidof(MSXML2::DOMDocument40)); but I don't want a new XML doc I need a new HTMLDoc.
PS:
I'm using the Paul Di Lascia's HTMLCtrl, it is not more than a HTMLView derived class that can be placed inside a dialog.
I need to create the new HTMLDocument because I want to write the information directly from memory inside the HTML page (this part is done and working well) the problem that I have is that I must create thenew document using the "about:" workaround (but it leaks some memory...)
Thank you in advance...
|
|
|
|
|
How about having an empty HTML document in your Resource file, loading that and then populating it with whatever your need. I'm doing stuff like this in a app I'm developing.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Neville Franks wrote:
How about having an empty HTML document in your Resource file, loading that and then populating it with whatever your need.
hmmm... sounds interesting. When do we get to see an article?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Nitron wrote:
hmmm... sounds interesting. When do we get to see an article?
I have at least 6 ideas for articles I'd love to write, but when you work for yourself and therefore already work very long hours it is really, really difficult to find the time. That said it will definitely happen one day. For now I try and help folks out on the msg boards when I can, as my little contribution.
Creating and populating CHTMLView's etc. is quite easy to do. Have a look at: http://codeguru.earthweb.com/ieprogram/PKB.html[^]
If you want more info on this topic let me know.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I am currently working on a application that supports a script language. This language has had numerous modifications and does not suffice anymore. I started to look around for a generic solution and after looking at TCL first I found about Active Script Hosting. I now want to implement my own Active Script Host but do have some questions about the supported languages and possibilities.
The application I'm working on has to be able to send data via several protocols, so I have to be able to easily assign (byte) buffers to my own objects e.g.:
Define cmd : Command
cmd.buffer = 00, 01, 02, 03, 04, 05, ...
Is it possible to do a similar thing in one of the support languages? Is there a preferable language that I should use (e.g. I read JScript support Arrays and VBScript does not)? Is It also possible to include other files into the vbscript/jscript script files?
|
|
|
|
|
1) You can create/add your own named objects. No problem there.
2) I don't think you can have something like
cmd.buffer = 00, 01, 02, 03, 04, 05, ...
but you can have:
cmd.buffer = "00, 01, 02, 03, 04, 05, ..."
or cmd.buffer = "00 01 02 03 04 05 ..."
or cmd.SendBuffer("00 01 02 03 04 05 ...");
>Is it possible to do a similar thing in one of the support languages.
Is there a preferable language that I should use (e.g. I read JScript support Arrays and VBScript does not)?
Most Com object can be used with any ActiveScripting languages. I always trying to keep it that way. If customers want to use Perl, Ruby - fine.
>Is It also possible to include other files into the vbscript/jscript script files?
VBScript, Javascript - no. Your host - yes. Your host can transform files before they submitted to scripting engine. ASP host converted
"abc" -> Response.Write "abc" &vbcr
|
|
|
|
|
When i compile my app for non XP systems, my registry functions all work fine. When i compilthem with WIN32_WINNT 0x0501 and ATLtheme.h included, it messes up. The only real difference i note is that the paths in the non-xp version are MS-DOS like (C:\win~1).In the XP version nothing get's written to the register at all. What should i do to make it work for both versions of my app?
this is the code i use:
<br />
char tFileName[MAX_PATH];<br />
CAtlString tAtlFileName,tAtlFileName2;<br />
<br />
HKEY hKey;<br />
RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run",0 , KEY_QUERY_VALUE, &hKey);<br />
<br />
HMODULE modhandle = GetModuleHandle(NULL);<br />
GetModuleFileName(modhandle,tFileName,MAX_PATH);<br />
tAtlFileName = tFileName;<br />
tAtlFileName2 = "\"" + tAtlFileName + "\"" + " /background";<br />
strcpy(tFileName,tAtlFileName2);<br />
<br />
RegSetValueEx(hKey, "Tim", 0, REG_SZ, (CONST BYTE *) tFileName, (int)strlen(tFileName));<br />
<br />
MessageBox(0,tFileName,"aan",0);<br />
|
|
|
|
|
i want to pass a HANDLE to a com dll.but how can i do this
thank you!
|
|
|
|
|
A HANDLE is just a number ( 32 bit, from memory, or maybe only 16 ).
The real question is, will it have meaning in the context of the COM dll ?
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
To pass a pointer or handle to a COM object, simply just pass it as a long, and in the COM Object you cast it back to what you know it is, like MyHandle = (HANDLE)newVal;
It's kinda dangerous, but works perfectly fine
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Unless you have OLE automation type requirements on your interface, you can pass it as it is. IIRC, HANDLE is just a void* . Passing it as long is not 64-bit safe.
--
Shine, enlighten me - shine
Shine, awaken me - shine
Shine for all your suffering - shine
|
|
|
|
|
I have a window that is hosted by other windows. I don't want it to draw its background because the dialog that hosts it has a special background, however, even with the transparent setting, CDialogImp still paints its background, thus making the transparent setting worthless to me. Is there an easy way around this? Is there another base class I could be using that works better for windows hosted in other windows?
|
|
|
|
|
The WS_EX_TRANSPARENT style doesn't automagically make your window transparent. It just means that your window gets painted last, after all sibling windows. That means all your drawing has to be confined to the region of your window, so the end result is your window looks transparent. And use SetBkMode(TRANSPARENT) before drawing text.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
BUY MY SOFTWARE!! (please?) RightClick-Encrypt | 1ClickPicGrabber
My IntarWeb Homepgae!!!11
|
|
|
|
|
I didn't mean to imply that there would be free transparency. The issue is that in ATL the window background is always painted. In MFC this isn't necessarily the case (or at least does not seem to be). This is especially important when dealing with tab pages in XP themed work. I've never had problems with MFC painting the window background and thus obscuring the white tab page (as long as the window flags were set correctly). But I always have to catch the WM_ERASEBKGND
|
|
|
|
|
Can anyone point me to a primer on how to use ATL control versioning? I need to change the interface for a control (adding new methods) and I want to bump up the version number. I need to know what changes to make to my controls RGS/IDL files to allow both versions of the control to be used. There doesn't seem to be any ATL7 control samples on the MSDN that use versioning...
When I am king, you will be first against the wall.
|
|
|
|
|
The easiest way to do this is to NOT version the control. What you are supposed to do is create a new interface that the control also implements. for example
you would have two interfaces in your IDL file.
interface ISomeInterface : IUnknown
{
};
...
coclass SomeInterface
{
interface ISomeInterface;
};
Your Implementation class would be some class:
class CSomeInterface : public ISomeInterface, ( others here ) { };
What you need to do is a new interface like
interface ISomeInterface2 : IUnknown // or you could derive from ISomeInterface depending your requirements
{
};
and then
coclass
{
interface ISomeInterface;
interface ISomeInterface2;
};
and class
// of course if you derivce ISomeInterface2 from ISomeInterface you can leave out
// ISomeInterface from the inheritence list below.
class CSomeInterface : public ISomeInterface, ISomeInterface2 ( others here ) { };
Hope This is what you were looking for.
Good Luck.
Joseph Dempsey
joseph_r_dempsey@yahoo.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
Does anyone know if ATL7 is available as a separate download from MS, or if there are any plans to ship ATL7 with the Win32 SDK...?
When I am king, you will be first against the wall.
|
|
|
|
|
ATL, like MFC is part of Visual C and can not be downloaded.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi,
today I feel like a little child not understanding anything from the bitmap API. What I want to do is to fetch a large image via the clipboard using one of the CF_BITMAP of CF_DIB types. Since I need the data in an image processing application I must convert the data to some specific format, namely a 24 bpp DIB. Nothing special, but the format of the DIB in the clipboard can be anything. Additionally I need the data in my own data buffer and finally the image is tiled and must be composed back into one image using supsequent calls the the external application and ::GetClipboardData.
Since the image is very large I don't want to copy memory around just to compose a DIB from the clipboard data, copy this DIB into a DDB with the desired new format and later copy the data into the user supplied buffer.
As I said, I feel like a little child today, not understanding anything anymore from the DIB/BITMAP API. While trying to solve my problem I had the following questions:
1.) How can I wrap a user provided buffer into a DDB or DIB?
It seems to me, that this is not possible, but why?
2.) What is the difference between a HBITMAP and a HANDLE or a HDIB? Or better, why does GetObject fail if I try to use it on a HANDLE returned from ::GetClipboardData (CF_BITMAP)?
3.) How do I wrap the data in the cipboard into a CImage? I cannot Attach to the HANDLE returned either from CF_BITMAP or CF_DIB and I can't use the API directly since there is no function to return the pointer to the start of the bits buffer. The function GetBits () returns a pointer to Pixel (0,0) which is in the most cases at the end of the bits buffer.
4.) What is the difference of a DIBSECTION and a DDB/DIB? The DIBSECTION seems to combine all the needs for a DDB and a DIB. It has BITMAP header and a BITMAPINFOHEADER. In the BITMAP header there is a member bmBits that points to the bitmap data. In the CImage::UpdateBitmapInfo this member is used as a pointer to the bits for a DIBSECTION image. But why is this member not valid for a BITMAP image?
5.) There are a lot of wrappers available for DIBs. One treats a DIB as an inherited CBitmap, another introduces a HDIB handle the next one only wraps the DIBSECTION API. All wrappers seem to be written before the existance of ATL7. But the CImage class still does not cover a good range of functions to deal with this problem. Is there a wrapper available that extends the CImage class for DIB/DDB conversion?
Thanks a lot for your answers.
Dirk
|
|
|
|
|
How would i go on making property sheets in WTL? I can't really find an example on this....
|
|
|
|
|
|
How can i make a system to hide/show Splitter Panes in WTL? I know you can hide them using SetSinglePaneMode(0) but i can't get the hidden one to show after i call this function.
|
|
|
|
|
SetSinglePaneMode() turns on/off the mode, depending on the param. Passing 0 is the same as SPLIT_PANE_LEFT, which means turn on 1-pane mode and show the current left pane only. Call SetSinglePaneMode() with SPLIT_PANE_NONE to go back to 2-pane mode.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|