|
I am a VC MFC-based programmer, from now on I decided to work on WTL based apps., but before doing my hands dirty with this specification, I decided to plan a demo app.
I first developed a MFC-based Dialog app with MFC dynamically linked. Then I developed a WTL-based Dialog app with ActiveX hosting enabled.
After compiling both applications, I found WTL execuatable was heavy then MFC-based application. I know that due to dynamically linking the size reduces to minimum of MFC-based app. But when I ran Dependency Walker I found the SIZE of MFC-based and WTL-based applications were same (along with the dependencies). Plus the executable time were same.
Please anybody has some idea what was happening, as I found everywhere that WTL is lighting fast.
Rgds
Dammy More
|
|
|
|
|
Not sure what your question is. Statically link MFC to make a more accurate comparison (since the WTL, ATL, and CRT code is statically linked to WTL apps all the time*).
*Assuming you don't use the MinSize build configurations, which you shouldn't because using ATL.DLL is problematic due to different versions not being compatible.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
Hi!!!
Suppose i develop a simple dialog based app in MFC using wizard and link MFC statically with it. On the other hand i develop the same application in WTL. Which package will be of smaller size ????
Actually i've heard the WTL based apps are of smaller size. But i experimented yesterday with both MFC dialog and ATL dialog. I sum the size of MFC based exe with all the dependencies. Then i sum the size of WTL exe with all its dependencies. What i noted is that the size remains same in both cases. Moreover the compilation time of WTL 7.0 based app, as i noticed was slow that the corresponding MFC based app. Are my observations correct ????
|
|
|
|
|
Shah Shehpori wrote:
Moreover the compilation time of WTL 7.0 based app, as i noticed was slow that the corresponding MFC based app. Are my observations correct ????
Just be sure you put all the WTL-includes in stdafx.h. I see no major difference in compile time between MFC and WTL.
As for the size: from what I've seen, WTL apps are in general smaller.
--
Only in a world this sh*tty could you even try to say these were innocent people and keep a straight face.
|
|
|
|
|
I'm having difficulty using this method, specifically...
lResult = reg.QueryStringValue("PathOut", regtext, sizeof(regtext));
It would be nice to see some examples using this CRegKey method or something. I can't seem to nail down the third parameter...
"The size, in TCHARs, of the buffer pointed to by pszValue. When the method returns, pnChars contains the size, in TCHARs, of the string retrieved, including a terminating null character."
TIA
Ryan
|
|
|
|
|
TCHAR szBuffer[128];
DWORD dwSize = sizeof(szBuffer) / sizeof(TCHAR);
lResult = reg.QueryStringValue ( _T("PathOut"), szBuffer, &dwSize );
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
Can somebody help me showing me how do I create two differente types of view.
My project is using ATL/WTL and is a MDI.
What I need is to be able to show two Childwindows with different content. One of them has to show my sales and the other my clients catalog.
|
|
|
|
|
Hi
I wrote the code to parse xml.I used smart pointers.i want to know wheather my code is correct.As i used smart pointers, i think no need to call release.But iam not sure about that wheni go through loop.Any suggestions would help me to do better.
IXMLDOMDocumentPtr docPtr;
IXMLDOMNodeListPtr NodeListPtr,NodeListPtr1;
IXMLDOMNodePtr DOMNodePtr,NextItemPtr,NextItemPtr1;
IXMLDOMNamedNodeMapPtr NamedNodeMapPtr;
docPtr.CreateInstance(_T("msxml2.domdocument"));
for(int i=0;i < NodeListPtr->length;i++)
{
NodeListPtr->get_item(i,&NextItemPtr);
NodeListPtr1=NextItemPtr->childNodes;
for(int k=0;k<nodelistptr1->length;k++)
{
NodeListPtr1->get_item(k,&NextItemPtr1);
if(strcmp(NextItemPtr1->nodeName,"IMAGE")==0 || strcmp(NextItemPtr1->nodeName,"HOTIMAGE")==0)
{
strcat(destpath,"\\");
strcpy(fullpath,NextItemPtr1->text);
ReturnFileName(fullpath,XmlFileAppPath);
strcat(destpath,XmlFileAppPath);
//MessageBox(NULL,destpath,"Value",MB_OK);
DownloadFile(NextItemPtr1->text,destpath);
strcpy(destpath,"");
}
}
}
NodeListPtr=NULL;
DOMNodePtr=NULL;
docPtr=NULL;
NextItemPtr1=NULL;
NextItemPtr=NULL;
NodeListPtr1=NULL
|
|
|
|
|
Seems OK. Do you have memory leaks?
AlexO
P.S. For performance the following might be an improvement
for(int i=0;i < NodeListPtr->length;i++)
should be
for(int i=0, count = NodeListPtr->length;i < count;++i)
|
|
|
|
|
Your code looks fine, but you dont need the following:
NodeListPtr=NULL;
DOMNodePtr=NULL;
docPtr=NULL;
NextItemPtr1=NULL;
NextItemPtr=NULL;
NodeListPtr1=NULL
Your smartpointers are automatically deleted when they goes out of scope
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
hi there,
I have a dialog and in it i have a button on which I want to send mail to a particular person. It just has the email address like someone@someone.com. when i click on it I want this E-mail to be entered into outlook's To address field. How can i do so. My guess was that there should be some function or methind doing so but could not find any. Can Anyone please help..
Himanshu
|
|
|
|
|
something like ShellExecute(NULL, "Open", "mailto:someone@someone.com", NULL, NULL, SW_SHOWNORMAL);
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I design a COM object by ATL, which has two IDispath. Default dispatch is IPlot2D, and the second is IMIDraw.
IMIDraw has a method Plot(), how do I launch Plot() method?
|
|
|
|
|
You can not. There is a rule(standard) of COM which states that you can only have one dispatch interface in the COM object. The reason for that is that late binding clients(VBS) use QueryInterface(IDispatch)/Invoke(methodID) for everything.
1. You can try to implement IMIDraw as separate object and expose it through a method of IPlot2D.
2. If they are polymorphic you can try to derive IMIDraw from IPlot2D, this way you can expose both interfaces and not violate the rule.
|
|
|
|
|
In addition to the previous reply, you can choose to implement your own IDispatch which will take care of all the methods for both interfaces. However, it is not the best solution, and you will have to take care to name clashes.
|
|
|
|
|
Thank you very much, solon.
I put a new method Plot0() in IPlot2D, and Plot() is launch there. It's OK.
Thanks again.
|
|
|
|
|
this is not exactly what I meant – I was talking about a custom implementation of IDispatch, where you redirect the Invoke call to the appropriate IDispatch implementation.
|
|
|
|
|
Hi again,
I am interested in writing a com/alt/ole object/server. Oh hell, I don't know what I want to write.
What I want is an object that you can insert into word or Autocad, that displays information with a customizable view. The object is to be created by a seperate desktop app, that embeds the data. I have played around with VC++ MFC AppWizard to create an ActiveX full server. This is kind of what I want. The UI that I envisioned was just a simple dialog box, not the inplace frame thingy that you get with MFC. Also, it is possible that this object will eventually wind up on the web so I was hoping to avoid MFC.
I have played around a little with an ATL full control. Can I register the control somehow so that it is avalible from the insert object menu in word? If not a control, ATL must have a template to serve my needs.
Maybe someone could point me in the right direction as far as what technology I should be studying for the desired outcome. COM is such a big topic !!!
Thanks,
Paul
ps. Think I need some
|
|
|
|
|
The task your planning is very interesting, but could be very difficult. One item on your list is easy, use ATL wizard to create full control, and make sure insertable is checked. As for the rest, you might want to go ALT/WTL, however only ATL part is well documented (check out MSDN samples/tutorials). The only decent resource for WTL I know of is ... this site. Check out the collection of the samples & libraries at http://www.codeproject.com/wtl. I am guessing your are new to COM (forgive me if I am wrong), so check out "http://www.amazon.com/exec/obidos/tg/detail/-/0201634465/qid=1041259989/sr=8-2/ref=sr_8_2/104-4316939-3607113?v=glance&s=books&n=507846" - it might help you.
|
|
|
|
|
Paul Silvernail wrote:
Can I register the control somehow so that it is avalible from the insert object menu in word?
There's a checkbox for this in the ATL wizard IIRC.
--
Only in a world this sh*tty could you even try to say these were innocent people and keep a straight face.
|
|
|
|
|
I'm using a COM Object that have a ConnectionPoint (event) that looks like this:
void RecognitionStoppedEvent(
RecognitionType RType,
ReasonType Reason,
IKVSet* RecResult);
Then I use a class that inherits from IDispatchImpl to receive the event.
Everything works fine, except I cant use the IKVSet*, I get an exception and the function just exists
An IKVset's IDL looks like this: interface IKVSet : IDispatch {code....}
I use this "definition" in my implementation of the event, but I'm not exactly sure about the VT_DISPATCH , is this the right varenum?
static _ATL_FUNC_INFO OnRecognitionStoppedEventInfo = {CC_STDCALL, VT_EMPTY, 3, {VT_I4, VT_I4, VT_DISPATCH}} ;
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
VT_DISPATCH corresponds to IDispatch* so that is correct. The event probably sends an IDispatch* , not an IKVSet* , so I'd first suggest QI'ing the pointer for IKVSet
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks a lot Mike, it did the trick
Why did'nt I think of that my self
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|