I want to expose some functionality of a internal object as a DLL - but that functionality uses variants. But I need to know: I can export a function with Variant parameters and/or return - or is better to go to an string-only representation?
What is better, from language-agnostic POV (the consumer is not made with Delphi - but all wil...
I have an OLEVariant disguised as a .Net object that I recieve from a client-side component over the net. I know that the contents are an array of bytes, but I don't know how to convert those contents to a native .Net byte array (byte[]). Any clues on how I can accomplish the conversion?
Edit: We answered our own question. To take an Ol...
I'm struggling with the following:
The goal is to parametrize an automation server for openoffice and I'm programming in Delphi.
The piece of basic code I want to translate into Delphi code is:
Dim aProps(1) As New com.sun.star.beans.PropertyValue
aProps(0).Name = "FilterName"
aProps(0).Value = "Text - txt - csv (StarCalc)"
aProps(1)....
I'm trying to use some legacy Delphi 5 DLLs from C# (2.0/3.5). Some of the exported functions are declared as such:
function SimpleExport: OleVariant; stdcall;
function BiDirectionalExport(X: OleVariant; var Y: OleVariant): OleVariant; stdcall;
I wish to set these up as delegates using Marshal.GetDelegateForFunctionPointer, but I'm ha...
I'm fairly certain that I can safely do:
void funcA(VARIANT &V,_variant_t &vt)
{
vt = V;
}
But what about the other way around:
void funcB(VARIANT &V,_variant_t &vt)
{
V = vt;
}
I've been seeing some REALLY weird behaviour in my app which I put down to COM-related threading issues. But then I got wondering if I was screwing...
I'm trying to use a COM component with the following method:
HRESULT _stdcall Run(
[in] SAFEARRAY(BSTR) paramNames,
[in] SAFEARRAY(VARIANT *) paramValues
);
How can I create in C/C++ the paramValues array?
...
I have been tasked to convert out VB6 program to VB.NET. In my research online everyone seems to say I need to go through my code and get rid of any Variants I have. I have had pretty good luck so far, but I am having an issue in replacing this one.
Private Sub lvThumbView_OLEDragDrop(Data As MSComctlLib.DataObject)
Dim File As Vari...
I have a VB6 application that uses a C# compiled Dll. I have been successfull in making this work by means of COM.
But my problem is that I have a Variant array with String and Double data types inside it. I need to pass this array to my C# Dll, which is receiving the array as an Object.
So, all I need to do is to convert the Variant arr...
where is this funtion in Delphi 2010
function Null: Variant;
begin
_VarNull(TVarData(Result));
end;
in Delphi 6 it was in Variants
...
hi,
I need to send a VARIANT value to another application using COPYDATASTRUCT. Here is the structure i'm using to send messages.
struct {
int i_MsgId;
VARIANT variant_Value;
}Message;
In my code I initialize the VARIANT to type BSTR and allocate a string as follows.
Message structMessage;
VariantInit(&structMessage.varian...
For a rules engine developed in C++, one of the core features is the value type. What I have so far is a bit like a COM-style VARIANT - each value knows its type. There are some rules for type conversion but it's a bit messy.
I wondered if there are nice drop-in value classes I could use which solve this, without requiring me to use a w...
I'm trying to understand how variants are implemented, and reading:
http://www.codeproject.com/KB/cpp/TTLTyplist.aspx
And I'm getting the impression that I can't write a variant that takes X types; but that the template writer picks some N, and I can only have less than-N types in a variant.
Is this correct?
Thanks!
...
I have tried reading:
http://www.boost.org/doc/libs/1_41_0/boost/variant.hpp
http://www.codeproject.com/KB/cpp/TTLTyplist.aspx
and chapter 3 of "Modern C++ Design"
but still don't understand how variants are implemented. Can anyone paste a short example of how to define something like:
class Foo {
void process(Type1) { ... };
...
Here,
http://stackoverflow.com/questions/2150618/how-do-i-fix-this-c-typelist-template-compile-error
we built a typelist, using the code from modern c++ design.
Question is now -- how do I take this and built it into a variant class?
Thanks!
...
Modern C++ design only gets me to typelists.
C++ templates the complete guide brings me only to tuples.
I want to learn how to _implement variants.
Does any C++ book explains this?
Thanks!
...
How efficient is dispatching on a boost::variant ?
If it's a switch statement, it should only take O(1) time, but as far as I know, template metaprogrammign can only generate if's, which would put boost::variant dispatchs at a runtime overhead of O(n), where n = number of types in the variant.
Can anyone confirm/deny/enlighten me on th...
Are there any easy-to-use, high-level classes or libraries that let you interact with VARIANTs in Visual C++?
More specifically, I'd like to convert between POD types (e.g. double, long), strings (e.g. CString), and containers (e.g. std::vector) and VARIANTs. For example:
long val = 42;
VARIANT var;
if (ToVariant(val, var)) ... ...
Working in Delphi7 just now, I noticed that not only a VarIsEmpty function exists, but also a VarIsEmptyParam.
Since the help of Delphi does not give much explanation:
VarIsEmptyParam returns true if the given variant represents an unassigned
optional parameter.
If the variant contains any other value, the function result is...
I have the following record definition
E3Vector3T = packed record
public
x: E3FloatT;
y: E3FloatT;
z: E3FloatT;
function length: E3FloatT;
function normalize: E3Vector3T;
function crossProduct( const aVector: E3Vector3T ): E3Vector3T;
class operator add( const aVector1, aVector2: E3Vector3...
I am working on a DLL in Delphi 2010. It exports a procedure that receives an array of variants. I want to be able to take one of these variants, and convert it into a string, but I keep getting ?????
I cannot change the input variable - it HAS to be an array of variants.
The host app that calls the DLL cannot be changed. It is written ...