|
Except that using count does much more than you need. Much like using strlen/size to test to see if a string is empty. Thus it is a performance problem. Even with a map, count with get the lower bound and then the upper bound for that key. Then it computes the delta of the two iterators. (V7 implementation)
If you want to create some form of a test, create a template function to do the find and then test for end. Then again, you can just use the insert and avoid the needless double search.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Is there a way to use commands like cout in a command line in a WTL program? This could be very useful for debugging to monitor how and when events are being called (for example).
|
|
|
|
|
A GUI app can call AllocConsole() to create a console window. See the MSDN topic "Reading and Writing Blocks of Characters and Attributes" for some sample code.
You can also write the debug stuff with ATLTRACE (or the API itself, OutputDebugString() ) and then run an app that shows the debug output.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Okay thanks! Works perfeclty
|
|
|
|
|
Hi all, I am trying to send a binary file via webservice.
The web method takes in the file as a byte[] and the stub function generated by Visual Studio takes an ATLSOAP_BLOB type as the file.
My question is: how do I construct an ATLSOAP_BLOB from a binary file? I can read in the file as byte[] or char[] but ATLSOAP_BLOB requires unsigned char* as the data.
Do I need to manually encode my char* using base64 to unsigned char*?
Any suggestion would be appreciated!
|
|
|
|
|
Hi folks,
I'm making a shell extension (the worst documented part of programming ever) and I want to handle keyboard accelerator commands for it. In a dialog based you'd add TranslateAccelerator to the message loop but in a extension I have no such loop. How do I catch such accelerator commands?
I'm making a namespace extension so I want to be able to handle them both in the treeview and the shellview.
Would really appreciate any ideas. I've searched all over internet for this but I'm pretty new to extension programming so it's hard to find things. Thanks for you help.
/Benny
|
|
|
|
|
Hi
I have taken ATL COM Appwizard to create ATL Service and selected Service as my option. My intention is that i have to create a service which starts my Server Application as a service which is written in VC++. My Server Application is Dialog based. When the Service is started how should i know that service is started.
Where i have to insert code to start my Service. please help me with code.
Thanks in Advance.
|
|
|
|
|
|
What would be the best way to implement additional features to an existing Activex developed via ATL, without breaking the current contract ?
There are a bunch of clients using the current code, and would not like to break the current functionality, in other words, I would like that new and old clients use the same Activex without breaking.
Thanks in advance
|
|
|
|
|
hello
I developed a activeX com component(.ocx) which is having only two property tabs named "set properties" and "extended". I want to add another property page tab in property sheet view. How can i add and use it.
-- modified at 1:26 Monday 7th November, 2005
|
|
|
|
|
In Dialog Resource Say Insert and select Property Page and say ok....
Now a new property page is created...create a class for it using class wizard and use it.
|
|
|
|
|
Hi everybody,
I have created a WTL MDI application. When it runs and the childframe window opens in the mainframe, I can capture the command messages generated by menu items selection in the OnForwardMsg handler of the childframe window. But I can't get the messages generated by toolbar buttons click with the same menu items identifiers.
I want to know what is wrong here. Why can't I get command messages by toolbar buttons click in the childframe window?
yours,
Roozbeh.
|
|
|
|
|
Hi!
I'm using ATL to create ADO connection connection
but linker errors occur.
unresolved external symbol _CLSID_CADORecordset
unresolved external symbol _IID_IADORecordset
unresolved external symbol _CLSID_CADOConnection
unresolved external symbol _IID_IADOConnection
my code :
# include <atlbase.h>
# include <adoid.h>
# include <adoint.h>
# include <comdef.h>
CComPtr<ADOConnection> p_Con;
CComPtr<ADORecordset> p_Rst;
CoCreateInstance (CLSID_CADOConnection, NULL,
CLSCTX_INPROC_SERVER,IID_IADOConnection,
(LPVOID *) &p_Con);
CoCreateInstance (CLSID_CADORecordset, NULL,
CLSCTX_INPROC_SERVER,
IID_IADORecordset, (LPVOID *) & p_Rst);
Pleas help
B2C
|
|
|
|
|
|
|
|
Hi Friend,
I want to create a link list using STL. I am doing the following
-----------------.h file---------------
struct CNode
{
long x;
_bstr_t b;
_bstr_t c;
};
class A
{
...
typedef std::list<cnode*> SEC_MSG_DATA;
SEC_MSG_DATA node;
...
}
--------------------------------------------------
I am trying to acces the member of the structure CNode through the object pointer of class A (pA->node.x) however i am getting the error
"is not a member of 'list<struct cnode="" *,class="" std::allocator<struct="" *=""> >'"
Can you please help me.
Thanks
|
|
|
|
|
Hi, I'm not sure I understood exactly what you're trying to do, but if you're trying to create a linked list of pointers to CNode's, then try this:
std::list<CNode*> nodes;
Then you can add to the list via pA->nodes.push_back(xxx). To traverse the list, you can something like:
std::list<CNode*>::iterator itNode;
for( itNode = nodes.begin(); itNode != nodes.end(); itNode++ )
{
CNode *pNode = *itNode;
// do something with pNode here
}
Hope that helps,
--
jthomps
|
|
|
|
|
Hello,
I dont know, how to implementate a registration script
"hInstance needs to be the module / instance handle
of the module that contains your server registration
script (resource ID 102) .."
the server registration script is importand to
register my OPC Server.
RegisterServer()
HRESULT RegisterServer(void)
Return Values S_OK upon success, otherwise the result code
returned from the ATL registrar component.
The success of this operation is dependent on the application
including a registry script resource as part of its EXE.
The resource ID MUST be 102. An example resource script
is shown below:
HKCR
{
NDI.SimulationSvr.1 = s 'NDI Simulation Server'
{ CLSID = s '{1E52DE00-FA5E-11d2-91C6-F8E932000000}'
...
Best regards
Thomas
|
|
|
|
|
Never used ATL COM, but today I came across a little ATL COM test program, it is created by ATL COM AppWizard, all the settings are by default. a new ATL object was added into the project, and a new property Score with it.
STDMETHODIMP CContrl::put_Score(float newVal)
{
MessageBox("afsf");
return S_OK;
}
Then I inserted this ActiveX Contrl into another Dialog base project, and when Score property value was changed, the message box was prompted.
But the problem is when I add this contrl to a webpage inside Frontpage and going through the same process, the message box doesn't shows up
|
|
|
|
|
For using on WebPage, I think, you will need to do some settings using DCOMCnfg.exe. I am not sure, check out.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
AX controls have to be marked "safe" before you can use them in IE. Look up IObjectSafetyImpl in MSDN.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
You cannot truly appreciate Dilbert unless you've read it in the original Klingon.
|
|
|
|
|
Hi Friends,
I am store some data into vector and mapping it long key for searching (1::1 mapping).Below code
---------------------.h file------------------------
typedef std::vector<item *=""> m_cache;
typedef std::map<long, item="" *=""> m_index;
typedef std::pair<long, item*=""> INDEX_ENTRY;
INDEX_ENTRY IndexEntry(Item * plu);
--------------------.cpp-------------------------
m_cache.push_back(item);
m_index.insert(IndexEntry(item));
-------------------------------------------------
Now the requirment is to retrive the same data with any of 2 different key long1 and long2 from the same vector(1::2 mapping). Can you please help me how to do this?
Thanks
|
|
|
|
|
please correct your message: < and > characters should be writen as < and >
and then u can get some help..
|
|
|
|
|
Hello!
I have a problem when define struct in atl 7.0. I develop it in vc.net. That's part of code below:
My com component has a face ISimpleFace:
//FILE SimpleFace.h
//my costum struct
struct tPosition
{
double x;
double y;
};
// ISimpleFace
[
object,
uuid("1C499BAD-9BAE-47AF-966F-EB972FA8DF47"),
dual, helpstring("ISimpleFace 接口"),
pointer_default(unique)
]
__interface ISimpleFace : IDispatch
{
[id(1), helpstring("方法TestStruct")] HRESULT TestStruct([in] struct tPosition pos);
};
When I complie it, out some errors:
e:\work\mysimpleface3\simpleface.h(23) : error MIDL2011 : unresolved type declaration : tPosition [ Parameter 'pos' of Procedure 'TestStruct' ( Interface 'ISimpleFace' ) ]
e:\work\mysimpleface3\simpleface.h(23) : error MIDL2009 : undefined symbol : [ Parameter 'pos' of Procedure 'TestStruct' ( Interface 'ISimpleFace' ) ]
What's the problem,how to define a struct in vc.net? Is there somebody can help me? Thanks!
|
|
|
|