Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 -> doesn't work, but . works but not???

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
djeryd Posted - Jan 19 2006 : 02:38:33 AM
I am using VAX 1440 and is working with VSFlexGrid v7.1

To access it I use this code:

IVSFlexGridPtr spGrid = m_Grid.GetControlUnknown();


(m_Grid is my grid variable that I have a DDX_Control to).

When I type
spGrid->
I don't get a list at all, if I hit Ctrl+Space I will get a list of methods, etc. but then I don't get any help for the parameters. But if I type
spGrid.
then I get the list of methods, etc. at once and help with the different parameters which is what I want. The problem is, that since spGrid is a (smart) pointer it will not compile if I type
spGrid.
so I will have to go back and change that to
spGrid->
afterwards.

24   L A T E S T    R E P L I E S    (Newest First)
djeryd Posted - Aug 14 2006 : 07:25:22 AM
1532 works fine for me know with COM smart pointers!
support Posted - Aug 12 2006 : 11:14:39 PM
Build 1532 has better support for COM smart pointers.
Shai-Hulud Posted - Feb 23 2006 : 5:29:21 PM
Feline,

thanks for taking the time to run such a thorough test and providing such great feedback, it is (as usual) very much appreciated.

Regards

Kai

feline Posted - Feb 23 2006 : 2:56:59 PM
currently no Office at all installed on this test system, so i have installed MS Office 2000. now that this is installed i have returned to your example. i have had to change the import statements to use the full path's to the office files, but the code compiles.

however i seem to be getting different results to you.

firstly, with the line of code:

Word::_DocumentPtr document;

both "Word" and "_DocumentPtr" are being underlined by VA as mistyped symbols. when using the document variable

document. - this produces a fairly short list of options
document-> - this produces a much longer list of options

i then restarted the IDE, and now i am getting different results.

on the line of code:

Word::_DocumentPtr document;

both "Word" and "_DocumentPtr" are shown in italic for stable includes and they are no longer underlined.

document. - this now produces a long list of options, on reflection this looks like the two separate lists from my first test merged together.
document-> - the first time this gave me a list of 4 items, but after that no items are listed at all.

something very strange is going on here, and there are definetly similarities to what djeryd is reporting. i have updated case=997 with these results.
Shai-Hulud Posted - Feb 22 2006 : 4:02:53 PM
quote:
Originally posted by feline

a nice clear set of instructions

however when i try just adding the #import lines to a C++ console project i get the compiler error:

fatal error C1083: Cannot open type library file: 'mso9.dll': No such file or directory

having done a full find i do not have this file on the test machine. which version of MS Office do i need installed to import these files? and does this rely on the MS Office development features in VS2005? from memory this requires that the correct version of Office is installed before you install the IDE



Ah, of course. I'm having good old Office 2000 installed. You may want to replace the reference to MSO9.dll to whatever MSOx.dll you find on your system. This, of course, also applies to the Word Type Library.

Apart from all that, I assume my issue to tightly connected to the one djeryd is experiencing.

Regards

Kai
feline Posted - Feb 22 2006 : 2:54:56 PM
quote:
Originally posted by Shai-Hulud

Sorry about not being clear about this. I meant to simply #import the MS Office Type Libraries into my project.


a nice clear set of instructions

however when i try just adding the #import lines to a C++ console project i get the compiler error:

fatal error C1083: Cannot open type library file: 'mso9.dll': No such file or directory

having done a full find i do not have this file on the test machine. which version of MS Office do i need installed to import these files? and does this rely on the MS Office development features in VS2005? from memory this requires that the correct version of Office is installed before you install the IDE
feline Posted - Feb 22 2006 : 2:45:45 PM
djeryd does leaving the IDE with the solution open for a few minutes make any difference, or help in any way? i have just recreated this test, and after pasting in the code from here i was getting very poor results on the pointer. on one occasion "spGrid->" only gave me 4 members when i tried CTRL-SPACE. however after a couple of minutes i started getting better results, but still not correct.

now i know to look for it there are no function prototype tooltips on the -> completion listbox for me.

i have listed all of my results, including the fact that the behaviour seems to vary a lot in a bug report.

case=997

thank you for your input here.
djeryd Posted - Feb 22 2006 : 03:07:32 AM
feline
I have tried what you suggested (i.e. to press Ctrl+Space) and then it works sometimes but now always (just typing -> will sometimes give me the latest function I have used). What never works with -> is that it doesn't give me the parameters of the function, which . does give.

support
I already has turned on "guessing" and as I say above it sometimes works and gives me the functions but never the parameters.

As for a sample, the one the I put together and feline made even smaller shouldn't be to hard to test against, I hope at least...
Shai-Hulud Posted - Feb 21 2006 : 6:13:10 PM
quote:
Originally posted by feline


assuming i know absolutely nothing about "Office CoClasses" can you tell me how to go about setting up a test case?



Sorry about not being clear about this. I meant to simply #import the MS Office Type Libraries into my project.

Would you prefer to receive a sample project or just some pseudo code? Actually, all you'd have to do is create an MFC project (I did for this matter) and do the following in the main CPP file:

 #pragma warning(push, 1)
 #import <mso9.dll> rename("DocumentProperties",  "DocumentPropertiesXL")   
 #import <vbe6ext.olb> 
 #import <msword9.olb> rename("ExitWindows", "WordExitWindows")
 #pragma  warning(pop)

Never mind the warnings that I suppress, it's just a sample after all :D

Next, somewhere in the _tmain enter the following:

 Word::_DocumentPtr document;

Now, when you

 document.

You get the list of all valid members on the smart pointer, whereas when you

 document->

You get nothing (at least for me).

BTW: When I enable "Get content from default Intellisense", neither works (neither . nor ->). I get the status bar message: " IntelliSense: 'Expression to the left of . or -> has a type which could not be resolved' (see 'Troubleshooting Intellisense in C++ Projects' for further help)."

Thanks for your support

Kai
support Posted - Feb 21 2006 : 5:27:27 PM
As feline suggested, there are cases of templates which VA X does not parse properly. Our only hope of fixing the parsing problems is to get small samples which exhibit them. If we get sample projects that include all files and/or definitions, debugging and fixing is possible. Hence, if you have a case for which VA X cannot offer help, you might do some digging to narrow down the class definition and create a sample project with a similar, yet much smaller, case.

We have setting in our options dialog to help when VA X is clueless with certain code. You can enable the "guess" option if you want VA X to guess when it doesn't know what a symbol is, but beware because it guesses based on similarity of names so you can sometimes get wacky results.

Another option is to tell VA X to use "default Intellisense", i.e. display what the IDE suggests and if the IDE suggests nothing, go ahead and display what VA X thinks is appropriate. This option works well for users with templates.
feline Posted - Feb 21 2006 : 5:21:08 PM
quote:
Originally posted by Shai-Hulud

I experience the very same issue with Smart Pointers generated for Office CoClasses.


assuming i know absolutely nothing about "Office CoClasses" can you tell me how to go about setting up a test case?
feline Posted - Feb 21 2006 : 5:19:34 PM
djeryd i have added this line of code to a C++ console program, using VS2003 and VA 1440. i used this because i have one of these projects on hand.

i get this when pressing CTRL-SPACE after a dot, which looks like a smart pointer interface to me:



and i get this when pressing CTRL-SPACE after ->, which looks like the control API to me:



for ease the full code i have used is:

#include "stdafx.h"

#import "E:\\common_share\\library code\\vsflexgrid\\vsflex7l.ocx" no_namespace

int _tmain(int argc, _TCHAR* argv[])
{
    IVSFlexGridPtr spGrid;
//  spGrid->

    return 0;
}


can you try the same simple test at your end? this is not quite how you described laying out the code, but by the looks of it VA is working correctly with this.
Shai-Hulud Posted - Feb 21 2006 : 01:34:05 AM
Let me double the last post.

I experience the very same issue with Smart Pointers generated for Office CoClasses.

This is VS 2005 Pro and VAX 1440.

I get everything (ie every member) for the plain vanilla dot, but when dereferencing, I get nothing at all.

Regards

Kai
djeryd Posted - Feb 20 2006 : 10:32:12 AM
Sorry again...

Replace the #import line with this one:

#import "c:\\source\\vsflex7l.ocx" no_namespace


The little "l" at the end loads the non-database variant of VSFlexGrid.

So it's just to create a MFC Dialog app, add the #import line and then in the code add a
IVSFlexGridPtr spGrid;
line and then type
spGrid.
and all the members will be displayed but if you type
spGrid->
(which is the correct one) then they don't get displayed.
feline Posted - Jan 26 2006 : 3:13:25 PM
apologies for the delay, i have been very busy. i have a basic win32 project created in VS2003. i have added the #import line to "stdafx.h" and tried to compile the code, to see if i have the right files in the right place.

i am not really getting anywhere.

i started with the error:
Debug\\vsflex7.tlh(863): error C2146: syntax error : missing ';' before identifier 'DataSource'

which i fixed by adding:
#include "vsflexdatasource.h"

to my "stdafx.h" file. this then left me with the undefined class "COleDispatchDriver", which i fixed by adding:

#include <afxdisp.h>

to the top of my "stdafx.h", which then got me right back to the error about "DataSource"

assume i have no idea what to do with these library files, what is the minimum i need to do to set up a valid test?
djeryd Posted - Jan 26 2006 : 03:17:53 AM
Since this thread was "stolen"... Any update on the original "-> doesn't work, but . works but not???" problem?
nikb Posted - Jan 23 2006 : 10:03:42 AM
quote:
Originally posted by felinehave you actually tried your own example in your own code?[/i]


Yes, and it used to fail. When you posted your samples, where it obviously worked, I got curious and went spelunking. To make a long story short, the problem went away after I rebuilt the symbol databases and cleared the history, cache and temporary files.

-n
djeryd Posted - Jan 23 2006 : 01:43:42 AM
quote:
i have downloaded and extracted your zip file, but i cannot find any reference to the string "FlexGridPtr" in any of the files.

i had a look for the evaluation copy, and having downloaded the files "vsflex7_7.0.1.190.zip", "vsflex7_203.zip" which looked like good ones to try i have the file types ".txt ; .ocx ; .ver ; .dll", and that is it. this seems to be the dll to link against, but no class definitions to use.

am i missing something obvious here?



Sorry, I forgot to mention that you must also include:
#import "c:\\source\\vsflex7.ocx" no_namespace


in the StdAfx.h file.
feline Posted - Jan 22 2006 : 2:08:08 PM
quote:
Originally posted by nikb

My previous example was written somewhat hastily. Here's a better one:

*snip*

Is this clearer?


much clearer. have you actually tried your own example in your own code? having placed your template class (which makes perfect sense to me) into a C++ header file, using VS2003 and VA 1440, i then created an instance of your smart pointer class, using the class felineURL, a small test class i am using.

the results are as follows:





i have just checked my VA options, and "get content from default intellisense" is turned *off*. this may be relevant.

i am quite happy to accept that VA has problems with some template code, but it should, and in my tests does work with some smart pointer classes. if this fails for you i am interested to know why. it could be that some specific setting, or project configuration option is key.
feline Posted - Jan 22 2006 : 1:58:48 PM
quote:
Originally posted by djeryd

I am using VSFlex7 (and C++/MFC...) I have zipped together the different VSFlex files and put them at http://www.trixsystems.se/vax/VSFlex7.zip

An evaluation version can be downloaded from http://prerelease.componentone.com/ActiveX/C1FlexGrid/C1FlexGrid%207.0/



i have downloaded and extracted your zip file, but i cannot find any reference to the string "FlexGridPtr" in any of the files.

i had a look for the evaluation copy, and having downloaded the files "vsflex7_7.0.1.190.zip", "vsflex7_203.zip" which looked like good ones to try i have the file types ".txt ; .ocx ; .ver ; .dll", and that is it. this seems to be the dll to link against, but no class definitions to use.

am i missing something obvious here?
nikb Posted - Jan 19 2006 : 11:11:24 PM
quote:
nikb i am a little out of practice at writing template classes, but i regularly use them in my C++ code. your example class does not make much sense to me, and definitely does not compile in VS2003 C++. if you have a smart pointer example that VA fails to handle then i am quite happy to test it to see if i can reproduce the problem.



My previous example was written somewhat hastily. Here's a better one:

class Test
{
public:
 void Foo() { /* some code */ }
};

template <class T> class MySmartPointer
{
 T* ptr;

public:
 MySmartPointer(T *p) : ptr(p) { }
 ~MySmartPointer() { delete ptr; }

 T* operator->() { return ptr; }
};

void FooTest()
{
 MySmartPointer<Test> tptr(new Test);

 tptr->Foo(); // does VA popup the member list for "Foo" here? Not for me.
}


Is this clearer?
djeryd Posted - Jan 19 2006 : 2:35:48 PM
I am using VSFlex7 (and C++/MFC...) I have zipped together the different VSFlex files and put them at http://www.trixsystems.se/vax/VSFlex7.zip

An evaluation version can be downloaded from http://prerelease.componentone.com/ActiveX/C1FlexGrid/C1FlexGrid%207.0/
feline Posted - Jan 19 2006 : 2:16:32 PM
the short answer is that VA should and does support smart pointers. there are some known and outstanding bugs with COM smart pointers, in fact one such bug was fixed in 1440.

djeryd do you have a link where i can download a trial version of VSFlexGrid? without a copy of the smart pointer class its self to test with there is not a lot i can really say.

after a bit of a look around i am ending up at the page:

http://www.componentone.com/pages.aspx?PagesID=228&Panelindex=1&Itemid=66&ItemType=1&gclid=COW3haqu14ICFUNZMAodzhjvIA

which contains the statement:

VSFlexGrid Pro 8.0 a powerful upgrade to the MSFlexGrid, comes in the box with Visual Basic.

the code you are referring to does not look like VB to me.


nikb i am a little out of practice at writing template classes, but i regularly use them in my C++ code. your example class does not make much sense to me, and definitely does not compile in VS2003 C++. if you have a smart pointer example that VA fails to handle then i am quite happy to test it to see if i can reproduce the problem.
nikb Posted - Jan 19 2006 : 03:57:49 AM
As a more detailed example of why this is beneficial consider the following ad-hoc example:
template <class T> MyListEntry 
{
 T* ptr;
 MyListEntry<T> *next;

 T* operator() const { return ptr; }

 MyListEntry<T> *GetNextLE() { return next; }
};

[... some other code ... ]

MyListEntry<T> *DoSomething(MyListEntry<T> *le)
{
 while(le)
 {
  if(le->Foo()) // note "Foo" is SomeClass::Foo"
   return le;

  le = le->GetNextLE();
 }
 
 return NULL;
}


After accounting for any typos in the code, this is perfectly legal C++. I would argue that VAX should be able to display the subset of SomeClass members (both functions and variables) that are appropriate (e.g. showing public, and perhaps protected members) when the user types ->

To be more general, I think that should VA display the dropdown of members for non-pointer instances of classes for which 'operator ->' is defined and returns a non-POD pointer type.

-n

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000