|
I want to generate random numbers.
plz. help me...
|
|
|
|
|
Hi,
I was looking at the spirit stl extensions, and I was wondering if it's possible to use it to parse a unicode (wide character) string in VC++ 6. I know that the source editor in vc6 only supports single-wide characters, but I was thinking maybe I can use _T() to make all of the strings wide, and then that spirit will be smart enough to do everything OK.
Is this a feasible idea? The strings that I want to parse are in unicode and use special unicode delimiters for their commands (which makes it easier to distinguish commands from normal text, so that's why I need unicode.
Any help would be appreciated.
Thanks,
Brucer
|
|
|
|
|
1. Spirit and VC6 aren't the best of friends - lets be honest, templates and VC6 aren't the best of friends . If you can upgrade to VC7.1, you'll be doing yourself a big favour, IMHO. Not only does VC7.1 ICE less, but it compiles code using Spirit (and many other parts of Boost, to be honest) much faster.
2. It would appear that Spirit does support wide characters to some extent - at least, the primitives (e.g. ch_p, str_p) take their character type as a template parameter.
3. To make strings wide in VC++, don't use _T() unless you can guarantee you're compiling with the UNICODE or _UNICODE macros defined. Instead, use wide string and character literals by prexifing an 'L' - e.g.
L"This is a wide string"
L'W'
4. You're probably more likely to get a coherent response to your queries on the Spirit Users mailing list[^].
Just to give you some encouragement - I've seen posts on the Spirit list about parsing binary (NOT character) data with Spirit. If you can do that, Unicode ought to be a snap!
HTH!!
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Hi,
I’m using collection with ATL and I have the following problem:
I would like to access the items in the collection from a function in the collection class and call a function
In order to create the collection I’ve used the collection wizard from this site.
The collection is vector of ICard items as followed (CCard is simple ATL object):
<br />
typedef ICollectionOnSTLImpl<IDispatchImpl<ICards, &IID_ICards>,<br />
vector< CAdapt< CComPtr<ICard> > >,<br />
ICard*,<br />
_CopyItfFromAdaptItf<ICard>,<br />
CComEnumICardVariantOnSTLvector><br />
ICardsImpl;<br />
class ATL_NO_VTABLE CCards : <br />
public CComObjectRootEx<CComSingleThreadModel>,<br />
public CComCoClass<CCards, &CLSID_Cards>,<br />
public ISupportErrorInfo,<br />
public ICardsImpl<br />
{<br />
I’ve tried to do it like this (CardToString is a function in CCard class and not part of the interface):
<br />
m_coll[i-1].CardToString(str);<br />
I am getting the following compilation error:
error C2039: 'CardToString' : is not a member of 'CAdapt<class atl::ccomptr<struct="" icard=""> >'
what should I do in order to access item functions that are not part of the interface in the collection?
|
|
|
|
|
Hallo,
How please to convert PWSTR to LPCTSTR ?
Thanks s a lot for helping
dabayi
|
|
|
|
|
W2A() should work. It's a macro that is in atl.h I think.
-- Rocky Dean Pulley
|
|
|
|
|
Thanks a lot.
That was the answer.
dabayi
|
|
|
|
|
|
hi,
i got this code -
<br />
CommandBar menuBar = applicationObject.CommandBars["MenuBar"];<br />
CommandBarControl m_TemplatesControl = menuBar.Controls.Add(MsoControlType.msoControlPopup,1,"",System.Reflection.Missing.Value,true);<br />
m_TemplatesControl.Visible = true;<br />
m_TemplatesControl.OnAction = "MyFuncName";<br />
the problem is that it never being called...
i want that when i press the control it will call the function
(it's popup and not button bcuz it got more commands inside it...)
help please,
Avi.
|
|
|
|
|
Wrong forum pal.
--
My name in Katakana is ヨルゲン.
My name in German is Jörgen.
I blog too now[^]
|
|
|
|
|
i don't think so, it's coded in ATL.
|
|
|
|
|
Hey all,
I'm having trouble finding the C++ header files:
atlwin.h
atlbase.h
atlcom.h
If anyone can help me by providing them, or a method of retrieving them I'd greatly appreciate it. Thanks.
-Dave
|
|
|
|
|
Either in the atl\include folder of your Visual Studio 6 installation or the atlmfc\include folder of your Visual Studio.NET installation. If you don't have an installation of Visual Studio, you don't have them.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Thanks, but I can't seem to find the Visual Studio 6 installation.
Can I download it from the web? If so, where?
Does it need to be bought?
-Dave
|
|
|
|
|
SwimmerDave wrote:
Does it need to be bought?
Yes
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
|
I'm getting exception error initialiing an PWLX_NOTIFICATION_INFO object.
here the code.
<br />
PWLX_NOTIFICATION_INFO pInfo;<br />
<br />
pInfo->Domain = L"myDomain";<br />
pInfo->UserName ,L"myUser1";<br />
pInfo->Flags = NULL;<br />
pInfo->hDesktop = NULL;<br />
pInfo->hToken = NULL;<br />
pInfo->pStatusCallback = NULL;<br />
pInfo->Size = NULL;<br />
pInfo->WindowStation = NULL;<br />
<br />
printf("Username = %s\n",pInfo->UserName);
what am I doing wrong?
thanks for helping.
dabayi
|
|
|
|
|
I'm not sure if this is causing the exception - but you're supplying a pointer to a wide string as a parameter for the %s format item, which expects a pointer to a normal string.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
You have a typo:
pInfo->UserName ,L"myUser1";
It should be:
pInfo->UserName = L"myUser1";
Also, to print a WSTRING using the ANSI printf, use %ls. That is the letter L, not the number one.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
I made a very nice duplicate file finding utility for myself a few months ago.
Now I just wanna share it with you guys (altough I am not very sure who would ever require such a tool ! Anyone ?)
However, I just want to add some more features to the basic framework.
The basic engine just creates a hash table of filenames which are kind of open chained using linked list of filenames which have the same MD5/SHA/etc digest (that is, are binary equal)
It currently finds out any duplicate file(s) in/on your directory/drive and deletes all but the file with the most recent timestamp.
That's all I wanted, but I understand that it's the least somebody who seriously wants to use such tool would want !
So please, let me know who might want it, and what feature(s) should I add to it....
Given enough takers, I might write up a nice article to go along with the source code.
In the meanwhile, keep the feature requests rolling in...
Regards
Subhobroto Sinha
http://www.geocities.com/subhobrotosinha
|
|
|
|
|
I have following task: in my custom MS Outlook CommandBar set up icons on buttons, I can't to use PasteFace or PutFaceId methods for this, I must to use Picture property.
My code.
HICON hi = LoadIcon(_Module.GetModuleInstance(), MAKEINTRESOURCE(IDI_ICON1));
if (hi)
{
PICTDESC pd;
pd.cbSizeofstruct = sizeof(pd);
pd.picType = PICTYPE_ICON;
pd.icon.hicon = hi;
IPictureDispPtr spIPicture;
hr = OleCreatePictureIndirect(&pd, IID_IPictureDisp, FALSE, (void **)&spIPicture);
hr = spCmdButton->put_Picture(spIPicture);
}
outlook raise exception "Incorrect parameter" in line with put_Picture call.
Can anybody help me with it?
Thanks
Ernst.
|
|
|
|
|
I had inserted from InsertMenu->new ATL Object->Miscallenous->Dialog
Give it short name MyDialog.Then inserted Microsoft Web Browser(By Right clicking on dialog and choosing
insert ActiveX Control).Now my problem is how can i call www.yahoo.com
in the control and get Documentcomplete and events such as were user clicked.
Plz help Me
Thanks in advance
Devom
|
|
|
|
|
|
As told in the article
CComObject<cmaindlg> dlgMain;
dlgMain.AddRef();
if ( dlgMain.Create(NULL) == NULL )
{
ATLTRACE(_T("Main dialog creation failed!\n"));
//return 0;
}
dlgMain.ShowWindow(SW_SHOWDEFAULT);
}
not working.
Now the program is compiling without any errors.But when i am clicking button then only Dialog Box is visible without ActiveX Control and that too with illegal operation, asks to close and send Error Report.
I know that the problem is somewhere with Create function .i.e. Dialog box is not creating.I also removed ActiveX control from Dialog Box ,then too the problem continues.It means that Dialog Box is not being Created.
But i don't know how and what to do.I tried as
For that i called AtlAxWinInit(); in CMainDlg::OnInitDialog();
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
AtlAxWinInit();// Added this
CAxWindow wndIE = GetDlgItem(IDC_IE);
CComPtr<iwebbrowser2> pWB2;
HRESULT hr;
hr = wndIE.QueryControl ( &pWB2 );
if ( pWB2 )
{
CComVariant v; // empty variant
pWB2->Navigate ( CComBSTR("http://www.codeproject.com/"),
&v, &v, &v, &v );
}
but same problem continues.Any one Plz help me
|
|
|
|