AVAX-software.com Forums: GetLayers C++ - AVAX-software.com Forums

Jump to content

Page 1 of 1

GetLayers C++ Sample for GetLayers in C++

#1 User is offline   BChristensen Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 09-May 07

Posted 09 May 2007 - 11:17 PM

I am using C++ (.NET 2005) to get the layers. I need to pass in 2 SAFEARRAYs'

	SAFEARRAY *pLayerNames;
	SAFEARRAY *pLayerStatus;
	SAFEARRAYBOUND saBound[1];
	//first dimension
	saBound[0].cElements = 256;
	saBound[0].lLbound = 0;

	pLayerNames		= SafeArrayCreate(VT_BSTR,	1, saBound);
	pLayerStatus			  = SafeArrayCreate(VT_I2,	1, saBound);

	m_cAvax.GetLayers(&pLayerNames, &pLayerStatus);
//now I can modify layer names

	m_cAvax.SetLayers(&pLayerNames, &pLayerStatus);



The code crashes with a Type Mismatch error.....

Any help would be great. Ive searched he NET on SAFEARRAY and VB/VC

First time using SAFEARRAY.

Thanks,
Brian Christensen

#2 User is offline   BMX Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 13-December 07

Posted 16 December 2007 - 03:20 PM

Hello Brian
It seems like our problems are the same
I also have a problem manipulating the SAFEARRAY structure.

I also had the routine GetHandlesUnderSelectCursor that seems to crash out uder calling it!

Still waiting for the help!

If you have any news, please reply.

thanks a lot

#3 User is offline   Athanasios Gardos Icon

  • Administrator
  • Icon
  • Group: Admin
  • Posts: 333
  • Joined: 21-March 05
  • Gender:Male

Posted 17 December 2007 - 08:51 AM

The reason is that these functions "redim" the SAFEARRAY. I'm trying to find a solution. If there is not a solution I will change the way you are calling those functions.
Athanasios Gardos
Avax-Software.com

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users