|
ok, I'm just starting to learn how to pass more complicated things from my C++ objects to vb (which I'm just starting to learn).
Currently I can't seem to figure out how to get my safearray out of the variant passed through my callback interface. This safearray needs to be passed back through a callback interface ACROSS process boundaries (no passing by ref allowed).
_____________________________________
the C++ side of this is as follows
SAFEARRAY *saHashCodes;
saHashCodes = SafeArrayCreateVector( VT_I4, 0, nNumHashCodes );
for ( U32 index = 0; index
|
|
|
|
|
You should also specify the VT_I4
var.vt = VT_ARRAY | VT_I4;
In ServerLink_ReturnPrivateHashList function you can have your array in "saHashArray" parameter. It will be the array of Long (not Integer!) values. You can obtain any value from him
Dim i As Long<br />
i = saHashArray(0)<br />
' or i = saHashArray(x), where x = 0,...,nNumHashCodes-1<br />
' or i = saHashArray(x), where x = LBound(saHashArray),...,UBound(saHashArray)
Or you can obtain whole array, but it's the same in it's usage
Dim arr() As Long<br />
arr = saHashArray
With best wishes,
Vita
|
|
|
|
|
excellent, it worked like a champ! 3 books, 2 newsgroups and about 4 irc channels later your the first person that could answer that. I really appreciate the help!
|
|
|
|
|
Hi
I have some procedure:
Sub SomeSub(ByRef somearray() As Double)
'some code, it doesn't matter
End Sub
I'm trying to call it in this way:
Dim somearray(10) As Double
SomeSub (somearray)
And I get such error message(it's my translation from polish, so it might be different on your computers):
Compilation error:
Argument of type Array must be passed by reference (ByRef)
I don't know what is wrong.
I almost forgot to add, all the code is runned as a macro in Word97
Greetings
|
|
|
|
|
Try adding the word Call in front of your routine call, this should do the trick, it works on my computer.
Private Sub Form_Load()
Dim MyArray(10) As Double
<code>Call</code> Some(MyArray)
End Sub
Sub Some(ByRef SomeArray() As Double)
MsgBox "Hello"
End Sub
Nick Parker
|
|
|
|
|
Great thanks. It works, somehow, VB is very strange.
|
|
|
|
|
|
This small example will help to understand the role of "()" around the argument
Sub Func(ByRef i As Long)<br />
i = 12<br />
End Sub<br />
<br />
Private Sub Form_Load()<br />
Dim j As Long<br />
j = 33<br />
Call Func(j) ' ByRef<br />
Debug.Print "j="; j ' the output will be: j= 12<br />
<br />
j = 33<br />
Call Func((j)) ' ByVal<br />
Debug.Print "j="; j ' the output will be: j= 33<br />
<br />
j = 33<br />
Func (j) ' ByVal. Note that there is the <font color=blue>space</font> between function name and argument<br />
Debug.Print "j="; j ' the output will be: j= 33<br />
Unload Me<br />
End Sub
With best wishes,
Vita
|
|
|
|
|
Does anyone have any experience in using Leadtools twain for .Net? I'm struggling through their examples trying to figure out how to use the SetCapabilities option. The example that Leadtools provides is extremely confusing.
|
|
|
|
|
Anyone have any recommendations on some good VB.Net books? I'm an old school, top-down programmer trying to get into the swing of this object oriented stuff and would appreciate some recommendations on good step by step instructional materials. Thanks.
|
|
|
|
|
For the amount of learning curve required for VB.NET why not try C#, its a more of a purist language and fits nicely into the .NET side of things, also once C# is mastered you can all most program C/C++.
BTW: what's your language background?
Normski. - the next bit of code is self modifying ... jmp 0xCODE
|
|
|
|
|
My background is mostly with Visual Basic (up to version 6). I would prefer to stick with VB as it would be less of a learning curve for me, but I intend to learn C# in the future as I also have a bit of C, C++ background. The project that I will be working on needs to be written in VB.Net (as mandated by those who are funding the project)
|
|
|
|
|
Yes, I think regardless of whether you choose C# for development VBers should learn it at least to the extent of being able to read it. The reason is that some parts of the documentation and some utilities use C# only. And this also applies to some examples. With .NET, C# examples are now (in most cases) open to VB and it would be a pity not to take advantage of this merely because you can't read C#.
The same applies to a lesser extent to C#ers. They should be able to read VB.
Kevin
|
|
|
|
|
Norm Almond wrote:
once C# is mastered you can all most program C/C++.
Superficially, this seems true. You will be able to understand the basic syntactical elements. But C++ is way more complicated than C# and in fact you would still have a lot to learn to write C++ according to best practices.
I'm actually originally a C++ developer. But after spending lots of time with C# and then going back to C++ it looks awful by comparison.
Kevin
|
|
|
|
|
I don't actually own it yet. But I've heard good things about "Programming Microsoft Visual Basic .NET" by Francesco Balena. Also I own his "Programming Microsoft Visual Basic 6.0" and it is very good.
Good luck.
Dan Morris
_____________________________________
"An eye for an eye makes the whole
world blind." - Ghandi
|
|
|
|
|
As you said you are a programmer with VB 6 experience, I will strongly recommend Moving to VB.NET - Strategies, Concepts and Code by Dan Appleman and published by Apress (ISBN: 1893115976). Dan Appleman is a great writer, and he designed this book to help VB6 programmers move to VB.NET. I read it when I first started learning VB.NET and it really helped me get started.
Thomas Brown
tbrown@plains.net
|
|
|
|
|
You *MUST* pick up Programming Visual Basic .NET by Francesco Balena. Not only is it a comprehensive reference, but you can learn from it too.
I guarantee that you will keep this book around you for your entire VB.NET lifetime.
Don't listen to people who say you should learn C# - after you've gotten the hang of VB.NET you'll easily move back and forth between the two languages. I admit I like C# better since it is terse, but VB.NET is a great launching point if you are already a VB developer.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
What, precisely, is the difference between the two? Both are meant to call the parent classes implementation of a member from a derived class, no?
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
You can use the MyBase keyword to call methods in a base class when overriding methods in a derived class.
The MyClass keyword allows you to call an Overridable method implemented in your class and make sure that implementation of the method in this class is called rather than an overridden method in a derived class.
Hmm...
|
|
|
|
|
Hi
MyBase's explanation goes like this:
The MyBase keyword behaves like an object variable referring to the base class of the current instance of a class. MyBase is commonly used to access base class members that are overridden or shadowed in a derived class. In particular, MyBase.New is used to explicitly call a base class constructor from a derived class constructor.
MyClass's explanation goes like this:
MyClass behaves like an object variable referring to the current instance of a class as originally implemented. MyClass is similar to Me, but all method calls on it are treated as if the method were NotOverridable. Therefore, the method being called is not affected by overriding in a derived class.
For difference between MyClass and Me refer
ms-help://MS.NETFrameworkSDK/vblr7net/html/vakeyMyClass.htm[^] from the .NET Framework SDK Documentation
Ravi Shankar S
Product Designer
iSOFT R&D Pvt Ltd
Chennai, INDIA
Ph: 91-44-4414980 Extn 1103
|
|
|
|
|
|
Does VB have the equivalent of the MFC Scrollview? I am after a scrollable canvas window.
Thanks!
Davy
www.latedecember.com
|
|
|
|
|
In Visual Basic 6, I want to make a mediaplayer executable using MS control: mediaplayer to play mpg files.
I've got a problem if I opened the same movie object twice without knowing whether or not a same application was playing at the moment.
How can I determine the status of a mediaplayer obect so that when I play it for the second time, the first one, if still playing, can be stopped and closed?
I have tried to mediaplayer.stop and end the application when either form and mediaplayer losts its focus. It is supposed to work like this: when I run/play a second movie, the first one may lost focus and thus being stopped and closed. But it failed, i.e when I click the application twice, the second one will pop up and run, however, the first movie will be running simutaneously at background.
Any comments and suggestions?
Thanks in advance!
DJ
DJ
|
|
|
|
|
Hello !!
Is anybody know where I get an ActiveX or dll that can be use in VB and by this object I can create a little moving picture screen which is received from a Web Camera. And I can take a still picture and save it.
I heard about SDK / COM. Where I can find this code, activex, dll, file exactly??
I have WebCam of Creative company.
Thank you !!
|
|
|
|
|
How can i make a asp page get executed(hosted in the local server) thru a visual basic exe.
i am putting the vb exe in the task scheduler of the windows and get the exe executed in a specific interval of time.which in trun calls the asp page.
i have tried using activexdocument.exe it works but when making it as an exe and calling thru the task scheduler,the asp page is not at all excuted.
can any one help me out,with appropriate code example.
Tks
Shiju
|
|
|
|