|
hello,
i write a atl com,and use the popup menu,and the menu can show rightly,and i add the menu command function,but when i click one menu item,the function does not run ,what is the matter?
i add the menu in the oncontextmenu,who can help me?
where can i upload my code?
thanks.
|
|
|
|
|
|
Obviously, it's a .com
--
Pictures[^] from my Japan trip.
|
|
|
|
|
|
Hi,
I am have some problems calling a DLL in embedded Pocket PC. The CoCreateInstance reply a error "Class not registered."
I have already register the DLL in the Pocket PC device and even in the emulator but I still keep getting the same error.
I have a running version for desktop but the same is having problems on embedded. In debug mode, I found that the DLLMain's parameter dwReason is = DLL_PROCESS_DETACH.
Can someone please help me?
Thanks in advance.
|
|
|
|
|
|
|
Separate compilation of templates has only recently been added to the standard. I haven't looked to see if this feature is present in VC>6 but I doubt it. If it did it would look like this:
<br />
template <class T> void foo(T);<br />
<br />
export template <class T> void foo(T t) { foobar(t); }<br />
Steve
|
|
|
|
|
export has turned out to be a failure.
And MS doesn't plan on supporting it anytime soon.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
You cannot truly appreciate Dilbert unless you've read it in the original Klingon.
|
|
|
|
|
I thought you were asking a question but looking back at the posts it looks like you were answering a question that was deleted which kind of "orphaned" your entry (thus making me think you were asking a question).
I'm not sure what you mean when you say "export has turned out to be a failure". There are compilers that support it although not many. Microsoft has always been slow (very, very slow) when it comes to standards compliance in its C++ compilers.
Steve
|
|
|
|
|
Stephen Hewitt wrote: I'm not sure what you mean when you say "export has turned out to be a failure".
I was reading up on export a while back, so my info may be out-of-date, but the group who does the compiling engine for Comeau took something like one man-year just to implement export . That was the same amount of time they needed to implement a compiler for the entire Java language. Plus, export turns out not to actally solve the problem in some cases.
I can't reveal my discussion w/the C++ compiler guys (it was at the MVP Summit and NDA'd) but their lack of support for export has nothing to do with being slow to conform to standards. Take a look at the previous paragraph and you can figure it out.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
You cannot stop me with paramecium alone!
|
|
|
|
|
I have read article "Making ATL OLE DB Provider templates support updating of data" at www.codeproject.com. Through reading your article, you must be a professional in "OLE DB Provider" field, I think so. Now, would you like to give me some help about this issue? You will be pretty appreciated.
1. In the file "IRowsetChangImpl.h" of your "Simple Data Object with update support", there is a row of code "HRESULT hr = pT->GetDataHelper(hAccessor, pColInfo, (void**)&pBinding, pDstData, cCols, spConvert, pRow);"(lies in method "SetDataHelper"). But there is not definition and implementation of "GetDataHelper". How to resolve it?
2. Now, I'm building up a updatable OLE DB Provider. This provider will be run in MS SQLServer DTS. First "Transform Data Task" of MS SQLServer DTS get the rowset from SQLServer, then call this provider, and pass rowset data to my provider by calling IRowsetChange::SetData(HROW hRow, HACCESSOR hAccessor, void* pSrcData). My questions are as following:
1) "Transform Data Task" pass the new data(a row of data include 10 columns) to my provider through method "SetData(HROW hRow, HACCESSOR hAccessor, void* pSrcData)". Is it correct?
2) I have get the DBBINDING info by the next code:
STDMETHOD (SetData)(HROW hRow, HACCESSOR hAccessor, void* pSrcData)
{
DBACCESSORFLAGS *pdwAccessorFlags;
DBCOUNTITEM *pcBindings;
DBBINDING **prgBindings;
DBBINDING *pBindings;
pdwAccessorFlags = (DBACCESSORFLAGS *)::calloc(1, sizeof(DBACCESSORFLAGS));
pcBindings = (DBCOUNTITEM *)::calloc(1, sizeof(DBCOUNTITEM));
pBindings = (DBBINDING *)::calloc(1, sizeof(DBBINDING));
prgBindings = &pBindings;
HRESULT hr = this->GetBindings(hAccessor, pdwAccessorFlags, pcBindings, prgBindings);
return S_OK;
}
Now, how can I extract data from pSrcData? I'm puzzled.
Expect for your reply!
Thanks in advance!
|
|
|
|
|
Hello?
I'm making RTL UI program using PropertySheet.
so I made a following source code. But it has a problem in Win98.(It's fine in Win XP).
I don't know why? who can explain and give me the solution?;)
Thanks, Have a good day!!!!!!!!
////////// Source code //////////////
static int CALLBACK PropSheetCallback(HWND hWnd, UINT uMsg, LPARAM lParam)
{ // dialog template is available and changeable pre-creation
if(uMsg == PSCB_PRECREATE)
{
LPDLGTEMPLATE lpDT = (LPDLGTEMPLATE)lParam;
lpDT->dwExtendedStyle += WS_EX_LAYOUTRTL ;
return 0;
}
else if (uMsg ==PSCB_INITIALIZED)
{
-- modified at 0:58 Wednesday 4th January, 2006
|
|
|
|
|
Hello.
q1: Is it possible to add control's to a dialog (CDialogImpl) by calling Create() for the control on INITDIALOG? Iv tried but it just dosn't show up. No error or anything. Is this possible? Or can you only use controll's that have been added by the resource editor?
q2: if this isn't possible. How do i create a window that is a child of the main frame, but appears as a dialog? Ie something equal to DoModal() to pop it up. I need a way to genereate the apperance of a dialog depending on what data i have. I cannot pre-make it in the resource editor.
Thanks in advance.
|
|
|
|
|
spaam wrote: Is it possible to add control's to a dialog (CDialogImpl) by calling Create() for the control on INITDIALOG?
Yes, this is possible. Post your code.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Come quietly or there will be... trouble.
|
|
|
|
|
Hello All,
Not to toot my own horn...well, OK...to toot my own horn
You may recall my step-by-step DCOM tutorial for VC6, which I posted at
http://www.codeproject.com/com/HelloTutorial1.asp[^]
The tutorial isn't meant to reveal the underlying theory and gory detail of DCOM itself, just like the Scribble tutorial wasn't exactly meant to tour every nook and cranny of MFC. However, the tutorial shows each step to take to build a very simple DCOM server and client.
People have been asking me to update the tutorial for VS.NET. And, at last, the new tutorial series is in the midst of being written. Check it out at
Step 1: http://www.codeproject.com/useritems/HelloTutorial1NET.asp[^]
The tutorial is written in several "Steps" -- the main parts of the process. Step 1 is linked above, and each Step contains links to every other step.
Do me a favor, and use the rating at the bottom of each step to score that Step, and post to the Steps' message boards with your questions, and also suggestions on how to make a certain Step better etc. I welcome any and all input, and both positive kudos and constructive feedback together are great. Thanks!
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
|
Could someone please give a novice a hand? class data { CString name; CString Address; CString age;};
vector<data> mydata. This will hold data I want to send to a database file.
Can someone show me how to format this class's data each time and send it to/receive from a file?
If I have to use a delimiter then how do I do this correctly and receive it correctly to place in a RECEIVING vector?
Please be patient with my ignorance and teach me!
PLEASE!
C++ is my favorite programming language
-- modified at 20:14 Friday 30th December, 2005
|
|
|
|
|
Maybe this will get you started:
#include <string>
#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
using namespace std;
class data
{
public:
data(const char* pName, const char* pAddress, const char* pAge):
name(pName), Address(pAddress), age(pAge) {}
string name;
string Address;
string age;
};
ostream& operator<<(ostream& s, const data& d)
{
s << "Name : " << d.name << "\n";
s << "Address : " << d.Address << "\n";
s << "age : " << d.age << "\n";
return s;
}
typedef vector<data> DataCollection;
int main(int argc, char* argv[])
{
DataCollection dc;
dc.push_back(data("Fred", "10 How st", "Fifteen"));
dc.push_back(data("Doug", "12 Now st", "3"));
dc.push_back(data("Sara", "5 Brown st", "10"));
dc.push_back(data("Joe", "9 Cow st", "34"));
ostream_iterator<data> osi(cout);
copy(dc.begin(), dc.end(), osi);
return 0;
}
NOTES:
I replaced your CStrings with std::strings because I like them better and they are standard. I've only show the writing part. I write to the screen instead of a file.
Steve
|
|
|
|
|
template <class T>
class CMessage
{
BEGIN_MSG_MAP_EX(CMessage)
MESSAGE_HANDLER(WM_NCLBUTTONDOWN, OnNcLButtonDown)
END_MSG_MAP()
LRESULT OnNcLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
T* pT = static_cast<T*>(this);
pT->DefWindowProc();
return 0;
}
};
class CMainDlg : public CDialogImpl<CMainDlg>,
public CMessage<CMainDlg>
{
public:
......
BEGIN_MSG_MAP_EX(CMainDlg)
CHAIN_MSG_MAP(CMessage<CMainDlg>)
END_MSG_MAP()
...
};
---------------------------------
i used spy++ see, WM_NCLBUTTONDOWN posted but not return? why i used pT->DefWindowProc(); but can't return?
|
|
|
|
|
You could try setting bHandled to FALSE in your message handler.
|
|
|
|
|
yes, used bHandled = FALSE can return, but i want returned and do something, but i don't know why pT->DefWindowProc(); can not do~
|
|
|
|
|
I don't understand your question. Posted messages don't have return values (but I'm not sure if this is what you mean).
Steve
|
|
|
|
|
1) Where can I learn to create my own Browser Helper Objects? Any suggestions?
2) How different VS2005 is from VS2003?
There are nice examples on this website but I couldn't compile almost any of them successfuly.
I think one of the reasons is new VS2005. After I download source file, then the whole project had to be converted. Most of time I get warnings
It would generated few warnings:
c:\...\basicpopupblocker\pubwhitelist\whitelist.h(71) : warning C4581: deprecated behavior: '"never"' replaced with 'never' to process attribute
c:\...\basicpopupblocker\pubwhitelist\whitelist.h(69) : warning C4581: deprecated behavior: '"apartment"' replaced with 'apartment' to process attribute
This doesn't sound right: '"apartment"' replaced with 'apartment' ... I see quote difference here, but I checked the code, didn't see any change.
... and on the end couldn't compile. I am trying to learn from these (I am big time novice). It seems that New VS2005 is doing ATL differently.
So, what to do? I am getting discouraged her. I am thinking to find VS2003 and forget about VS2005, at least until I learn something.
Thanks.
-- modified at 10:05 Friday 30th December, 2005
|
|
|
|
|
From MSDN:
Compiler Warning (level 1) C4581.
Error Message
deprecated behavior: '"string1"' replaced with 'string2' to process attribute
This error can be generated as a result of compiler conformance work that was done for Visual C++ 2005: parameter checking for Visual C++ attributes.
In previous versions, attribute values were accepted whether or not they were enclosed in quotation marks. If the value is an enumeration, it must not be enclosed in quotation marks.
See Breaking Changes in the Visual C++ 2005 Compiler for more information.
Example
// C4581.cpp
// compile with: /c /W1
#include "unknwn.h"
[object, uuid("00000000-0000-0000-0000-000000000001")]
__interface IMyI : IUnknown {};
[coclass, uuid(12345678-1111-2222-3333-123456789012), threading("free")] // C4581
// try the following line instead
// [coclass, uuid(12345678-1111-2222-3333-123456789012), threading(free)]
class CSample : public IMyI {};
|
|
|
|
|
Search MSDN for "BHO" and you should find some. They are plain COM objects so it doesn't matter what version of VS you have.
Attributed ATL should be avoided entirely, it doesn't work as advertised.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Ford, what's this fish doing in my ear?
|
|
|
|
|