|
Yes, the window procudure of the window will take care of the details.
Steve
|
|
|
|
|
Cool, Steve!
It is good COM Runtime implements the window procudure for us.
regards,
George
|
|
|
|
|
Hello everyone,
As mentioned in the book ATL Internals, when assign none to COM thread model,
--------------------
If there is no ThreadingModel given in the registry, COM will assume a legacy single-threaded class and access the class object from the process's first STA, creating a new STA is necessary. This protects objects from having to synchronize access to global, static, or instance data.
--------------------
I do not understand why "This protects objects from having to synchronize access to global, static, or instance data"? Any ideas?
thanks in advance,
George
|
|
|
|
|
Say you're using the STA threading model and have two threads (each STAs). If both of these threads instantiate the same COM object then any access to global data runs the risk of accessing the same data in both threads at the same time and thus corrupting it. If "none" is selected as the threading model the primary STA thread will be directly connect to the COM object and the other will use a proxy/stub to communicate to it's COM object with also lives in the primary STA thread.
Steve
|
|
|
|
|
Thanks Steve,
I want to confirm with you that all none thread-model COM objects will be created in the same primary STA thread?
regards,
George
|
|
|
|
|
That's how it works.
Steve
|
|
|
|
|
Thanks for review, Steve!
Question answered.
regards,
George
|
|
|
|
|
I'm looking into using MSXML for parsing, and possibly generating XML files.
Anyone have experience with this? Specifically is there a way I can cleanly package it as part of my product via an "xcopy install" method?
Or would it be necessary to run some installer on the end user's system to get the library installed and registered? I'm hoping on avoiding that as I don't want to require admin access to install and I'd rather be as self-contained as possible, not dumping other stuff on the users machine (outside my install dir).
Thanks!
|
|
|
|
|
This link has the versions listed that come along with IE. We've never had to put the MSXML components in our install packages explicitly since we require at least IE 5.5 and MDAC 2.7 on the machine to run our products. We do have the MDAC redistributable in the MSI for those machines that might need it.
MSXML[^]
modified on Saturday, April 12, 2008 12:53 AM
|
|
|
|
|
I am accustomed to RemovePreviousVersions uninstalling the previous version and installing the new one. I just need to increment the version number, accept a new product code and leave the upgrade code untouched.
But the vs2008 msi leaves the old versions of the files in the installation folder.
I have read that this is because vs2008 checks the version of the individual files, and if they have not changed, refuses to install the new file.
OK. So how do I increment the version number of the individual files? I do not want to have to change each file manually!
Thanks,
James
|
|
|
|
|
I have discovered a simple, almost crude, solution for this problem.
Remove the VERSIONINFO resource.
Now the installer will delete the old installed file and replace it with the one in the installation package.
To remove the VERSIONINFO resource:
- Open the resource view
- Open <projectname>.rc
- Open Version
- Right click on VERSIONINFO
- Delete
|
|
|
|
|
Dear all,
I don't know how to create shiny silver color for the background of a MFC dialog. Please provide me some clues for achieving this. How about by code?? What is the RGB value??
My friend asked me to insert a jpg for the background. Is it possible??
My and I are beginners of MFC. Therefore, we would like to hearing from experts. Thank you!
Best regards,
John
|
|
|
|
|
johndoelee wrote: What is the RGB value??
0xE6E8FA
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yeah its possible to insert jpg,bmp,gif,png,... to background of your program you can use of CImage class or GDI+ for it.
|
|
|
|
|
Hi!
This is more of a general question/rant... We have been using Crystal Reports for 10+ years and it has worked reasonably well. I am however somewhat disenchanted with the support in the BusinessObjects fora and just the other day did I stumble upon this:
http://technicalsupport.businessobjects.com/cs/forums/thread/18745.aspx
It seems that BO is pulling the plug on C++. I have no idea what they are smoking, but I will have a hard time finding a business case to convert a perfectly functional C++/MFC app to C#.
Anyone in the same quandary? What alternatives are there out there to embed reporting into a C++/MFC app
|
|
|
|
|
I am using a CList to store pointers to variables in the heap.
typedef CList < int*, int* > CIntList ;
int * pInt = new int ;
CIntList * pList = new CIntList ;
pList->AddTail(pInt) ;
delete pList ;
Does anybody know if deleting pList frees all the allocated memory? that is, do the pInt pointers get deleted as well or it has to be done somewhere else?
I might as well use a CList < int&, int& > CIntList anyway...
Thank you!
|
|
|
|
|
piul wrote: Does anybody know if deleting pList frees all the allocated memory?
Nope it doesn't. How could it know because you could also store integers there...
|
|
|
|
|
|
Delete the items in the list, then the list itself.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The only way I can think of, is deriving a class from CIntList, and implementing a destructor there that frees the memory.
Don't know if that's the best option
|
|
|
|
|
Probably allocating on the heap single integers is not a good idea.
Maybe you need to revise your overall design.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Unless a NULL pointer is the equivalent to a boolean in their design.
|
|
|
|
|
?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
For each integer, if negatives, positives, and zero are valid data, there is no way to indicate if the integer should be used or ignored. Basically, an on/off switch to say ignore the integer at this index or data is valid at this index. The pointer can be used as the boolean flag. Valid pointer is "On", and NULL pointer is "Off".
|
|
|
|
|
OK. But this has nothing to do with my original point: sistematically allocating single integers (or, if you prefer, single boolean values) on the heap it is usually not (IMHO) a good idea. Dynamically memory allocation for built-in types is usually bad.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|