473,386 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

C++ and collections

Hello

I am interfacing a C++ program with a VB program and I am trying to
determine how to properly define the collection in my c++ program. I
am using the import function to import the functions of the dll that I
am interfacing with and when I look at the tli file that is created
during the compile I see the following
inline _IMSUsersPtr _cIMSBch::GetIMSUsers ( VARIANT_BOOL UserGroups )
{
struct _IMSUsers * _result = 0;
HRESULT _hr = raw_GetIMSUsers(UserGroups, &_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _IMSUsersPtr(_result, false);

_cIMSBchPtr ptrIMSBch(__uuidof(cIMSBch));

ptrIMSBch->GetIMSUsers(FALSE);
I do above statement and it compiles but at this point it does not
have a problem because I don't have a datatype setup to return the
collection into

What I want is something like the following

usercollection = ptrIMSBch->GetIMSUsers(FALSE);

but I don't know how to define usercollection - From what I can tell
the return value definition is a

struct _IMSUsers * <---Does this mean that C++ sees the collection
as a ptr to a structure?

I have tried different things but have not come up with a solution

one of which was

_IMSUsersPtr ptrIMSUsersPtr(__uuidof(IMSUsers));

ptrIMSUsersPtr = ptrIMSBch->GetIMSUsers(FALSE);

This compiles but goes off into lala land when it runs

struct usercollection *collectuser

collectuser = ptrIMSBch->GetIMSUsers(FALSE); - does not compile

(ptrIMSUsersPtr)collectuser = ptrIMSBch->GetIMSUsers(FALSE); - does
not compile

Can someone help? I am a little confussed.

Ultimately we are going to have a function that returns a couple non
related data types as well as a collection. However the collection
will never be used in my interface but the dll I am interfacing with
requires the collection as something that needs to be returned because
other future interfaces might require the use of the collection. This
seems strange for me to ask to define something that is not used
directly but nonetheless it happens to be the case so given that I
need to do make sure that the collection is defined properly so that
it compiles and that can hold the returned data.

Any ideas?

Thanks
Jake

Feb 7 '07 #1
13 1537
On Wed, 07 Feb 2007 14:59:46 -0800, Jake wrote:
Hello

I am interfacing a C++ program with a VB program
[...]

I think you might rather try asking in a VB forum, as it appears that the
information you require is highly VB-specific; this newsgroup deals only
with C++ *language* issues.

Good luck,

--
Lionel B
Feb 7 '07 #2
* Jake:
>
I am interfacing a C++ program with a VB program and I am trying to
determine how to properly define the collection in my c++ program.
[snip]
struct _IMSUsers * <---Does this mean that C++ sees the collection
as a ptr to a structure?
When you're struggling with basic C syntax you should not be attempting
to interface C++ with other languages.

No doubt you'll get it to "work" and it will be full of bugs.

Forget it.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Feb 7 '07 #3
On Feb 7, 6:46 pm, "Alf P. Steinbach" <a...@start.nowrote:
* Jake:
I am interfacing a C++ program with a VB program and I am trying to
determine how to properly define the collection in my c++ program.

[snip]
struct _IMSUsers * <---Does this mean that C++ sees the collection
as a ptr to a structure?

When you're struggling with basic C syntax you should not be attempting
to interface C++ with other languages.

No doubt you'll get it to "work" and it will be full of bugs.

Forget it.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
I'm not sure why you wasted your time posting if you didn't have any
real insight into the issue. Maybe your just trying to feel superior
for whatever reason (tiny penis) but really all I wanted was some
help. After all that is the reason these groups exist. Your attempt
to insult me while I am trying to ask for help only makes you come off
like a jerk.

Feb 8 '07 #4
* Jake:
>
I'm not sure why you wasted your time posting if you didn't have any
real insight into the issue. Maybe your just trying to feel superior
for whatever reason (tiny penis) but really all I wanted was some
help. After all that is the reason these groups exist. Your attempt
to insult me while I am trying to ask for help only makes you come off
like a jerk.
Please don't quote signatures, don't post off-topic questions, don't
post infantile dribble to the group, and in general, read the FAQ before
posting. You got good advice in spite of that. Now please disappear.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Feb 8 '07 #5
On Thu, 08 Feb 2007 08:37:18 +0100, Alf P. Steinbach wrote:
* Jake:
>>
I'm not sure why you wasted your time posting if you didn't have any
real insight into the issue. Maybe your just trying to feel superior
for whatever reason (tiny penis) but really all I wanted was some
help. After all that is the reason these groups exist. Your attempt
to insult me while I am trying to ask for help only makes you come off
like a jerk.

Please don't quote signatures, don't post off-topic questions, don't
post infantile dribble to the group, and in general, read the FAQ before
posting. You got good advice in spite of that. Now please disappear.
Now, now children. To the OP: yes, you committed multiple heinous crimes
against Usenet etiquette (see above).

To Alf P.: that was to my mind unnecessarily snippy. In particular:

Alf P. Steinbach wrote:
When you're struggling with basic C syntax you should not be attempting
to interface C++ with other languages.
Perhaps you have never been in the situation where your job *forces* you
to engage with some technology that you are unfamiliar with. Not good,
but perhaps the OP has no option.
No doubt you'll get it to "work" and it will be full of bugs.
Maybe, but that's unhelpful.
Forget it.
Tell that to his boss.

--
Lionel B
Feb 8 '07 #6
Jake wrote:
I am interfacing a C++ program with a VB program and I am trying to
determine how to properly define the collection in my c++ program. I
am using the import function to import the functions of the dll that I
am interfacing with and when I look at the tli file that is created
during the compile I see the following
inline _IMSUsersPtr _cIMSBch::GetIMSUsers ( VARIANT_BOOL UserGroups )
{
struct _IMSUsers * _result = 0;
HRESULT _hr = raw_GetIMSUsers(UserGroups, &_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _IMSUsersPtr(_result, false);
The return value seems to be a class and not a raw pointer. That might be
the reason why your attempts did not work.

Since we can hardly guess what you are doing without actual source code and
class declarations, it would really be better if you ask this in a
Microsoft or VB specific newsgroup, as the other posters suggested.

--
Thomas
http://www.netmeister.org/news/learn2quote.html
Feb 8 '07 #7
Jake wrote:

I'm not sure why you wasted your time posting if you didn't have any
real insight into the issue.
*plonk*


Brian
Feb 8 '07 #8
On Feb 8, 2:55 pm, "Default User" <defaultuse...@yahoo.comwrote:
Jake wrote:
I'm not sure why you wasted your time posting if you didn't have any
real insight into the issue.

*plonk*

Brian
plonk your mom ass

Feb 8 '07 #9
Jake wrote:
>
plonk your mom ass
Is that English, or some odd language I haven't seen before?

--
Ian Collins.
Feb 8 '07 #10
On Feb 8, 3:44 pm, Ian Collins <ian-n...@hotmail.comwrote:
Jake wrote:
plonk your mom ass

Is that English, or some odd language I haven't seen before?

--
Ian Collins.
Ask the the dickhead Brian he uses it a lot maybe he will tell you
once he gets his head out of his ass He like Alf think they are
somehow superior to the rest of us but instead they do nothing but
whack off to their dad's gay porn collection all day.

Feb 8 '07 #11
Jake wrote:
On Feb 8, 3:44 pm, Ian Collins <ian-n...@hotmail.comwrote:
>>Jake wrote:

>>>plonk your mom ass

Is that English, or some odd language I haven't seen before?

Ask the the dickhead Brian he uses it a lot maybe he will tell you
once he gets his head out of his ass
Lets have a go at parsing your post.

to plonk - put someone in one's killfile.
mom - Americanism for mother
ass - either a wild donkey or the Americanism for arse.

So we have

"Put your mother donkey/arse in my kill file"

--
Ian Collins.
Feb 8 '07 #12
On Feb 8, 3:56 pm, Ian Collins <ian-n...@hotmail.comwrote:
Jake wrote:
On Feb 8, 3:44 pm, Ian Collins <ian-n...@hotmail.comwrote:
>Jake wrote:
>>plonk your mom ass
>Is that English, or some odd language I haven't seen before?
Ask the the dickhead Brian he uses it a lot maybe he will tell you
once he gets his head out of his ass

Lets have a go at parsing your post.

to plonk - put someone in one's killfile.
mom - Americanism for mother
ass - either a wild donkey or the Americanism for arse.

So we have

"Put your mother donkey/arse in my kill file"

--
Ian Collins.
Whatever floats your boat

Feb 8 '07 #13
Jake wrote:
On Feb 8, 3:56 pm, Ian Collins <ian-n...@hotmail.comwrote:
>>Jake wrote:
>>>On Feb 8, 3:44 pm, Ian Collins <ian-n...@hotmail.comwrote:
>>>>Jake wrote:
>>>>>plonk your mom ass
>>>>Is that English, or some odd language I haven't seen before?
>>>Ask the the dickhead Brian he uses it a lot maybe he will tell you
once he gets his head out of his ass

Lets have a go at parsing your post.

to plonk - put someone in one's killfile.
mom - Americanism for mother
ass - either a wild donkey or the Americanism for arse.

So we have

"Put your mother donkey/arse in my kill file"
Please don't quote signatures.
>
Whatever floats your boat
Water?

--
Ian Collins.
Feb 8 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: njp | last post by:
BlankHi, How do I create a tightly coupled Object 1 such that when I update it in one collection, it is simultaneously and automatically updated in other collections? The collections are defined...
1
by: Tim T. | last post by:
I'm currently working on a report to forecast production for finished goods. The user can select one or more items to forecast. In addition, they may select one or more warehouses to view...
5
by: Simon | last post by:
Hi all, I am writing a windows application using vb.net on the 1.1 framework. We have in the application, some strongly typed collections that have been written as classes that do not inherit...
4
by: nhmark64 | last post by:
Hi, Does System.Collections.Generic.Queue not have a Synchronized method because it is already in effect synchronized, or is the Synchronized functionality missing from...
4
by: Adam Clauss | last post by:
I ran into a problem a while back when attempting to convert existing .NET 1.1 based code to .NET 2.0 using Generic collections rather than Hashtable, ArrayList, etc. I ran into an issue because...
5
by: WebSnozz | last post by:
Some collections are such that efficient search algorithms work on them such as binary search if the collection is a type which is sorted. I'm wondering how LINQ searches these collections and if...
2
by: Fred Heida | last post by:
Hi, i'm trying to (using managed C++) implment the IEnumerable<Tinterface on my class.. but have a problem with the 2 GetEnumerator method required.... what i have done is... ...
4
by: Sid Price | last post by:
Hello, I have a class of objects (Device) that are managed by another object (Devices) with a collection class (DeviceCollection) inherited from Collections.Hashtable. Each of the Device objects...
5
by: Michi Henning | last post by:
I can pass a generic collection as ICollection<Tjust fine: static void flatCollection(ICollection<intc) {} // ... List<intl = new List<int>(); flatCollection(l); // Works fine Now I...
3
by: Marco Shaw | last post by:
I've got some C# code to create a custom PowerShell cmdlet with these statements: .... using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; .... ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.