Print Page | Close Window

SuiteCtrls WTL Sample

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2283
Printed Date: 13 July 2025 at 1:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SuiteCtrls WTL Sample
Posted By: burns7975
Subject: SuiteCtrls WTL Sample
Date Posted: 25 May 2005 at 8:39am

Where are there the SuiteCtrls WTL samples? When I import the Codejock.SuiteCtrls.9510.ocx I always get a long error list!!

thanks!

burns7975




Replies:
Posted By: JamesH
Date Posted: 25 May 2005 at 11:07am

Unfortunatley I don't think there is a WTL example, afaik there are only 2 WTL examples included.

I don't know if this will help or not, but this is the .h file I use to import the suite controls:

#include "stdafx.h"

#include <atlbase.h>

#include <atlcom.h>
#include <atlhost.h>
#include <atlwin.h>
#include <atlctl.h>

#import "olepro32.dll" no_auto_exclude

#import "C:\WINDOWS\system32\stdole2.tlb" rename("OLE_HANDLE", "XTP_OLE_HANDLE"), rename("OLE_COLOR", "XTP_OLE_COLOR"), rename("OLE_XPOS_PIXELS", "XTP_OLE_XPOS_PIXELS"), rename("OLE_YPOS_PIXELS", "XTP_OLE_YPOS_PIXELS"), rename("DISPPARAMS", "XTP_DISPPARAMS"), rename("EXCEPINFO", "XTP_EXCEPINFO"), rename("GUID", "XTP_GUID")
using namespace stdole;

#undef DT_TOP
#undef DT_LEFT
#undef DT_CENTER
#undef DT_RIGHT
#undef DT_VCENTER
#undef DT_BOTTOM
#undef DT_WORDBREAK
#undef DT_SINGLELINE
#undef DT_END_ELLIPSIS

#import "Codejock.SuiteCtrls.9700.ocx"
using namespace XtremeSuiteControls;



Posted By: burns7975
Date Posted: 25 May 2005 at 7:23pm

It is right!! Thank you, JamesH!

I have another question about your two wtl samples;

I always got the exceptions like this this:(vs.net2003, wtl75_5102)

Microsoft C++ exception: COleException @ 0x0012e210 。
Microsoft C++ exception: COleException @ 0x0012e210 。
 Microsoft C++ exception: COleException @ 0x0012e204 。
Microsoft C++ exception: COleException @ 0x0012e1e8 。

How can i correct this problem?

thanks!



Posted By: JamesH
Date Posted: 26 May 2005 at 11:31am

Sorry, I'm using VC 6 and don't see any of those problems.  Perhaps someone else or someone from codejock can help you out.

- James



Posted By: burns7975
Date Posted: 27 May 2005 at 9:25am

Hi, James:

I have another problem to need your help.

I want to add a view to the ShortCutBar like this:

HWND d = m_view.Create((HWND)m_spShortCutBar->GethWnd(), rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);
  m_spShortCutBar->Selected = m_spShortCutBar->AddItem(1,_T("Test"),(long)d);

But it doesn't work!

thanks!

burns



Posted By: burns7975
Date Posted: 27 May 2005 at 10:59am

Hi, James:

I have figured out above problem!

but I cann't make the ShortcutCaption working in the ShortcutBar  like the VB

Sample ShutcutBar does! Any idea?

thanks a lot!!

Burns



Posted By: JamesH
Date Posted: 27 May 2005 at 12:05pm

Hello Burns,

Unfortunately I don't use the shortcut bar.. what can't you get working with the shortcut caption?  Do you have a code segment you could post?

- James



Posted By: burns7975
Date Posted: 28 May 2005 at 1:43am

Hi, James:

My code is:

  if (!SUCCEEDED(AtlAxCreateControlEx(
   OLESTR("{95E24DB0-1BBC-4411-BA54-204565E95 4AE}"),
   (HWND)m_spShortCutBar->GethWnd(),
   NULL,
   NULL,
   &m_spShortCut,
   IID_NULL, NULL)))
  {
   return FALSE;
  }

  if (!SUCCEEDED(m_spShortCut.QueryInterface(&m_spShortCutBar Caption)))
  {
   return FALSE;
  }

  m_spShortCutBarCaption->PutCaption(_T("Test!" ));

but the following line doesn't work, because the AddItem's 3rd argument  needs a HWND

//m_spShortCutBar->AddItem(1,_T("This"),m_spShortCutBarCa ption);

What can I do?

thanks!

Burns



Posted By: JamesH
Date Posted: 30 May 2005 at 11:40am

I've never used the short cut bar but it looks like you need to do something like:

IShortcutBarItemPtr item = m_spShortCutBar->AddItem(1,_T("This"), hwnd() );

item->Caption = _T("New caption");

Where hwnd() is the window handle for the wndow to display in the client area.  (From the help file "hWnd

Child window associated with the shortcut, this window will be displayed in the client pane when clicked. " ).

 



Posted By: burns7975
Date Posted: 04 June 2005 at 11:33pm
Thanks!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net