|
Joergen Sigvardsson wrote: Dude.. it's 2007!
Tell that to Microsoft - it's copy'n'pasted from their documentation...
|
|
|
|
|
Just pullin' your leg..
--
Raaaaaaaaaaaaaaaaaaaaa!
|
|
|
|
|
Hi,
I am trying to fire an event from the worker thread and it worked fine as long as I worked with a VB client inside VB development environment. As I created an exe and ran, it was crashing and found that there is a KB article in Microsoft on that talking about marshalling the sink interface (http://support.microsoft.com/kb/q280512/ ). But, when I use that, I am getting a 0x80004002 error in the pDispatch->Invoke. Appreciate your help in sorting out this issue,
Thanks & Regards,
Satish
|
|
|
|
|
What have you done so far?
Have you initialized the new apartment with a call to ::CoInitialize() ?
You cannot fire events from a secondary thread without marshalling since the call crosses apartment boundaries.
You could also post a message to the main thread and fire the event from there.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hello Satishkumar,
Not sure why you are getting your error. I've tried to use ATLCPImplMT.h entirely as advised by the MSDN article in http://support.microsoft.com/kb/q280512/[^]
and faced no problem.
If you would like to have a look at my sample codes, pls email me :
bio_lim_2004@yahoo.com
Regards,
Bio.
|
|
|
|
|
//Belows are from MSDN2003, an example about hash_set::find
// hash_map_find.cpp
// compile with: /EHsc
#define _DEFINE_DEPRECATED_HASH_CLASSES 0
#include <hash_map>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_map <int, int=""> hm1;
hash_map <int, int=""> :: const_iterator hm1_AcIter, hm1_RcIter;
typedef pair <int, int=""> Int_Pair;
hm1.insert ( Int_Pair ( 1, 10 ) );
hm1.insert ( Int_Pair ( 2, 20 ) );
hm1.insert ( Int_Pair ( 3, 30 ) );
hm1_RcIter = hm1.find( 2 );
cout << "The element of hash_map hm1 with a key of 2 is: "
<< hm1_RcIter -> second << "." << endl;
// If no match is found for the key, end( ) is returned
hm1_RcIter = hm1.find( 4 );
if ( hm1_RcIter == hm1.end( ) )
cout << "The hash_map hm1 doesn't have an element "
<< "with a key of 4." << endl;
else
cout << "The element of hash_map hm1 with a key of 4 is: "
<< hm1_RcIter -> second << "." << endl;
// The element at a specific location in the hash_map can be found
// using a dereferenced iterator addressing the location
hm1_AcIter = hm1.end( );
hm1_AcIter--;
hm1_RcIter = hm1.find( hm1_AcIter -> first );
cout << "The element of hm1 with a key matching "
<< "that of the last element is: "
<< hm1_RcIter -> second << "." << endl;
}
Output
The element of hash_map hm1 with a key of 2 is: 20.
The hash_map hm1 doesn't have an element with a key of 4.
The element of hm1 with a key matching that of the last element is: 30
My question is: hm1_RcIter is definded as a iterator, how can it use the member function of Pair: "hm1_RcIter -> second "? what is wrong?
|
|
|
|
|
An iterator just has 2 pointers. First pointer points to the key value. Second pointer points to the value itself for that key. The member variable/function second is not a member of the pair class. It is a specific part of the iterator itself.
From what I can see, nothing is wrong with your code. What's the problem? Nothing.
|
|
|
|
|
I build my project with "Win32 Unicode Release MinSize" setting. It defines "_UNICODE", "_ATL_DLL", "_ATL_MIN_CRT". And I don't want my dll to use MFC and CRT.
now I need to format strings. I think I should prevent calling functions like "_stprintf" from using CRT. But I don't know other way to fromat strings. Can you tell me some helpful Win32 functions. Or, maybe my idea is wrong!
|
|
|
|
|
|
I have a dll written in C++ running in a Linux machine. Now i want to move that dll to a Windows system and use it with a Windows application.
How can i do that?
Can you please tell what all are the performance issues i face?
What all are the dependencies?
Thanks in advance
|
|
|
|
|
Do you want to use this dll on the C++?
|
|
|
|
|
Hi All,
I am working on an ActiveX based project.
I am using AtlAxCreateDialog method to create a dialog whose resources have been specified in a RC file. The dialogue gets created perfectly fine but i have not been able to handle its events like OnSize, OnClose etc
It has taken me a while to solve this problem but didn't succeed. Kindly, help me.
AZ
Aamir Zia
|
|
|
|
|
Calling AtlAxCreateDialog directly is unusual: normally it’s called for you in the implementation of the CAxDialogImpl::Create method.
Steve
|
|
|
|
|
I have created a toolbar for IE and added a an edit control to it, but I couldn't add a menu control beside to the edit control. Can anybody help me, please. Thanks a lot.
love U much...
|
|
|
|
|
first, create a menu in your resource file.
second, put a button to the toolbar that will open the menu up with a style BTNS_WHOLEDROPDOWN
third, get a command handler handle the button's command ( WM_COMMAND message )
and lastly, write a method that creates the menu and tracks it. something like:
HMENU hM = ::LoadMenu(ATL::_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(ID_MENU);
HMENU hMPopUp = ::GetSubMenu(hM,0);
::TrackPopupMenu(hMPopUp,TPM_TOPALIGN,pointX,pointY,0,m_hWnd,NULL);
that's the way i did it, i think you can handle the rest with the holy MSDN
|
|
|
|
|
There's this file that I wanna open from my web application, but I want it to open by Google Earth, the file is not located on the server it's on the user's computer but the application knows its name and path: "C:\\Places.kml"
How can I do that? I'm using ASP.NET web application in C#
|
|
|
|
|
Hello All,
I am opening a word document and save it usually and now i am changing some text in this file then
i have to save this file programmatically so what i have to for that.
If any one have idea about that please share with me.
Thanks & Regards
Bankey
|
|
|
|
|
What does this have to do with ATL/WTL? You are in the wrong forum...
|
|
|
|
|
Can you more explain and with which language?
|
|
|
|
|
Hi all!
I want to know how to pass an array of long to the method of COM
and how to return the array of long from that method.
Viral Joshi.
|
|
|
|
|
|
Hello,
Read the article on MSDN: “How to Pass Arrays between Visual Basic and C”. http://support.microsoft.com/kb/207931
Some more links:
1. "Passing an array from VC++ DLL to VB", by Amol Kakhandki on Code project. http://www.codeproject.com/dll/ctovbarray_passing.asp
2. http://www.manbu.net/Lib/En/Class5/Sub7/1/23.asp
Regards
|
|
|
|
|
This[^] might help.
Steve
|
|
|
|
|
Hi,
I'm kind of new to ATL programming, but I have been working with it quite extensively over the past few months. I've been writing code for a toolbar for IE and unfortunately I got stuck on one part and have no idea how to solve it. Google and MSDN are not being very helpful, but I think that the main reason I'm having trouble is because I do not understand the concepts fully.
Anyway, here is the problem: I want to be able to detect the WM_INPUTLANGCHANGE message within my toolbar. I tried adding it to the MESSAGE_HANDLER to one of the windows, but it seems to be ineffective.
Any information you can give me to point me in the right direction would be great!
You can assume that the code I have is the same as in this tutorial:
http://www.codeproject.com/atl/ietoolbartutorial.asp
Thank you in advance,
Andrej
|
|
|
|
|
What are the conditions in which a CAB fiel refuses to overwrite a previous downloaded instance in IE.
Is it the time-stamp of the CAB file;or do CAB files need to mention a versioning too.
We are downloading a CAB file from a jsp with a OBJECT tag.
After we modify the CAB file and repackage it ,we find that CAB file does not download the new instance again,as the old instance is already downloaded into the client box.
We are creatign the CAB file with visual studio.
If versionign is the answer to overwriting downloaded CAB files from IE - how do we version CAB files in 'VS Deployment type of projects'
|
|
|
|