|
Here is how I am sending it
Dim a(0 To 6) As Double
Dim Points As Variant
Dim np As Long
Dim nr As Long
Dim b(0 To 1) As Double
Dim Radii As Variant
a(0) = 0#
a(1) = 0#
a(2) = 0#
a(3) = 0#
a(4) = 0#
a(5) = 1.2
b(0) = 9.5
b(1) = 8.9
Radii = b
np = 2
nr = 2
MyCtrl1.Insert_Polycylinder np, Points, nr, Radii, "cap"
!!!!!!!!!!!
And here is how my control recieves it
STDMETHODIMP StreamCtrl::Insert_Polycylinder(int pcount, VARIANT * points_var, int r_count, VARIANT *radii_var, BSTR capping)
{
if (m_pView)
{
HPoint *points = new HPoint[2];
int dummy;
float *radii = new float[2];
char capping_char[4096];
ConvertToChar(capping_char,capping,4096);
GetPointArrayFromVariant(points_var, &points, dummy);
GetFloatArrayFromVariant(radii_var, &radii, dummy);
Insert_PolyCylinder(pcount, points, r_count, radii, capping_char);
}
return S_OK;
}
and then
Here are other relevent functions
void StreamCtrl::GetPointArrayFromVariant(VARIANT * varKeys, HPoint **arrayfloat, int &length)
{
int len;
GetArrayFromVariant(varKeys, (float **)arrayfloat, 0, 0,len);
length = len/3;
}
void StreamCtrl::GetArrayFromVariant(VARIANT * varKeys, float **arrayfloat, int **arrayint, char **arraychar, int &length)
{
length = 0;
VARIANT jArray;
VariantInit(&jArray);
if ((varKeys->vt & VT_TYPEMASK) == VT_DISPATCH) {
IDispatch* disp =
(varKeys->vt & VT_BYREF ? *varKeys->ppdispVal : varKeys->pdispVal);
DISPID DISPID_GET_SAFEARRAY(-2700L);
DISPPARAMS dispParams = {NULL, NULL, 0, 0};
HRESULT hr = disp->Invoke(DISPID_GET_SAFEARRAY, IID_NULL,
LOCALE_USER_DEFAULT,
DISPATCH_PROPERTYGET, &dispParams,
&jArray,
NULL, NULL);
if (SUCCEEDED(hr))
{
length = jArray.parray->rgsabound[0].cElements;
if (arrayfloat)
*arrayfloat = new float[length];
else if (arrayint)
*arrayint = new int[length];
else if (arraychar)
*arraychar = new char[length];
for (int i=0;i<length;i++)
{
VARIANT *res = (VARIANT *)jArray.parray->pvData+i;
if (arrayfloat)
(*arrayfloat)[i] = res->dblVal;
else if (arrayint)
(*arrayint)[i] = res->intVal;
else if (arraychar)
(*arraychar)[i] = res->bVal;
}
}
}
}
|
|
|
|
|
Hi,
I am working on VB application in which i want a textbox to accept only integers and few other characters.
like for house no I want only integers, #, / and backspace to be allowed. I wrote code it restricts alphabets only, not other alphabets.
If KeyCode >= 48 And KeyCode <= 57 Or KeyCode >= 35 And KeyCode <= 44 Or KeyCode = 45 Or KeyCode = 47 Or KeyCode = 8 Then
txtDoorNo.Locked = False
Else
txtDoorNo.Locked = True
End If
but its not working properly.
plz help ASAP.
With Regards ,
Chandan Kumar
|
|
|
|
|
Chandan_Kr wrote: If KeyCode >= 48 And KeyCode <= 57 Or KeyCode >= 35 And KeyCode <= 44 Or KeyCode = 45 Or KeyCode = 47 Or KeyCode = 8 Then
txtDoorNo.Locked = False
Else
txtDoorNo.Locked = True
End If
If you are using vb6 try to use the code keyascii = 0 or in vb.net use e.handle = true or e.handle = false
Try to test it.
|
|
|
|
|
Chandan_Kr wrote: If KeyCode >= 48 And KeyCode <= 57 Or KeyCode >= 35 And KeyCode <= 44 Or KeyCode = 45 Or KeyCode = 47 Or KeyCode = 8 Then
Looks like the logic is not being expressed rigorously. Perhaps a few parenthesis would help.
If (keycode >= 48 and keycode <= 57) _
or (keycode >= 35 and keycode <= 44) _
or keycode = 45 _
or keycode = 47 _
or keycode = 8 then
George
|
|
|
|
|
salam every one
i want ask again about data base with vb.net
iam working in project to build compiler to c++ not proffetional one but its project to compiler class
iam stop now in type cheking that takes about check if the type for the identefier correct or not
i was storing the data type as reserved in tabel and i connected this with the vb.net program to show if the string that i have it from reading it from text foun in data base or not
if found return it from data base if not found insert it as identefier with it's type
like when i type (int x;) in text and read it as line store it in string and convert this string to char array
and take int alone and search about it in the database if it found in data base return int
and take x alone too and search about it too if not found in the data base insert it as identefier x type int
what is the sql statment that i can use it
i know it is select and insert statement but how i can use it correctly
if i can do this one (type checking) it will be easy with parssing too
thanks alot and iam sorry to this long letter
noor al-huda
|
|
|
|
|
Hello
I would like to know how can I get a list of all the registered domain names in Mycomputer. I would like to get this information thru my code ( in VB )
thanx in advance
-- modified at 6:29 Monday 8th May, 2006
|
|
|
|
|
|
how do I use event with Datagridviewcolumn in datagridview control?
can you send me a code project about some event usage with datagridviewcomboboxcolumn?
my email address: sumroitha@yahoo.com
Datagridview control not Datagrid control.
|
|
|
|
|
Hi, Is this[^] answer to what you need?
|
|
|
|
|
Hello everybody. how do I open MDIChild Form from MDIChild Form? (VB.Net)
-- modified at 21:34 Monday 8th May, 2006
|
|
|
|
|
Hi, you came from the same country like me too.
roitha wrote: how do I open MDIChild Form from MDIChild Form?
Do you need the code to open MDI form in vb.net or vb6?
|
|
|
|
|
Hi,
What vb.net form events do we use when we need to detect if the "up" arrow key has been pressed? (down and up)
Right now, I am programming a simple "mario" game. When I press the up arrow key once, Mario has to jump up and land down in one smooth motion, just like in the original Nintendo Mario game.
The Mario character is represented by an Imagebox displaying the mario cartoon character.
I use the key down event handler but the problem is, once I let go of the up arrow key, Mario immediately stops. If mario is in the process of jumping up, it will just stop there in mid air. I have to press the up key continuously for the jumping motion to complete smoothly.
What event handler and keyboard code should I use for the "press a key once" event?
|
|
|
|
|
There is no event to handle directly for Arrow keys. Yes if you are talking about regular keys like A,B etc then keypress event will work. on Your situation use form level variable
on KeyDown Event set the time in that variable and on key up check the time of keydown and this way you can calculate that how much time the key was pressed . or if it has no concern with your applicaiton then only use KeyUp event of the container .
Rizwan Bashir
|
|
|
|
|
I need the code relenvent code for How to Connect "Oracle" and SQL Server in Visual Basic .
ritesh banerjee
|
|
|
|
|
In
Date.ParseExact(s as String,format as String,provider as system.IFormatProvider) as date,
what is provider as system.IFormatProvider argument refers?
|
|
|
|
|
A CultureInfo or DateTimeFormatInfo object.
---
b { font-weight: normal; }
|
|
|
|
|
hi guys ur frnd is looking for u, regarding...
I have created one chart in an excel file using VB.net. so I want to copy that chart and paste onto new power point slide and save it as new .ppt file?
I know that how to make a chart based on some excel data in the same excel file, latter I know how to save it. but the problem is I'm unable add that chart into ppt slide file.
I tried several times, but everytime ppt file is created with plunty of slides with one cell value of the excel sheet. I don't know what's the wrong with in.
let me know the process of this implementation?
want to be best student for ever.
-- modified at 0:54 Wednesday 10th May, 2006
|
|
|
|
|
how can we fill hindi data in text box using vb.net
Amit Sharma
|
|
|
|
|
For multi-lingual support you need to install regional language from Control Panel instead of any programming language. once it is added . you can switch from English to Hindi and write what ever you want and where ever you want.
Rizwan Bashir
|
|
|
|
|
in listview, how can i label edit subitem same to edit item text ?
|
|
|
|
|
Search for custom list view in Articles and you will find the answer
Rizwan Bashir
|
|
|
|
|
Well I have been pulling my hair out for ages now trying to work a way around this problem.
My VB code simply gets a row of data from a table an then passes it to my ATL COM which takes one paramter as an array pointer.
I keep getting the Type Mismatch before my COM gets called and this is documented by Microsoft here: http://support.microsoft.com/kb/818982/
<br />
System.Runtime.InteropServices.COMException (0x80020005): Type mismatch.<br />
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)<br />
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)<br />
I have all the service packs installed but I still keep getting the error so I can only assume its something Im doing. Can anyone help or suggest a work around ?
VB Snippet
<br />
Dim arrJumpTable As Object<br />
rs = CreateObject("ADODB.Recordset")<br />
rs.open(strSql, my_Conn)<br />
arrJumpTable = rs.GetRows()<br />
rs.Close()<br />
rs = Nothing<br />
<br />
Dim obj As Object<br />
obj = CreateObject("Trader.Mapper")<br />
Call obj.LoadMap(arrJumpTable)<br />
<br />
ATL COM<br />
<br />
STDMETHODIMP CMapper::LoadMap(VARIANT* vptrData)<br />
...<br />
<br />
__interface IMapper : IDispatch<br />
{<br />
<br />
[id(2), helpstring("method LoadMap")] HRESULT LoadMap([in] VARIANT* vptrData);<br />
};<br />
<br />
The array may contain in excess of 5000 entries and needs to be processed fast, hence using C++ for implementing a complex version of Dijkstra's Algorithm which works well in VB but takes around 45 seconds to to run. At the end of the day I need to access this COM object using VBScript fro a web page so the VB snippet above is from the test harness. Im still trying to get my head around ATL COM so its a bit of an uphill struggle at the moment.
I can call up other properties and methods in the COM object ok so I feel sure I have it built right.
I really appreciate any help here.
Thanks, Kess
Trying hard to get it to work
|
|
|
|
|
how do I use event with Datagridviewcolumn in datagridview control?
can you send me a code project about some event usage with datagridviewcomboboxcolumn?
my email address: sumroitha@yahoo.com
|
|
|
|
|
it have in msdn, search it.
|
|
|
|
|