473,548 Members | 2,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to marshal things ...

Hi!

I wonder, how the declaration of the following c-function must look like in
VB.NET

STATUS LNPUBLIC ConvertTextToTI MEDATE(
const void far *IntlFormat,
const TFMT far *TextFormat,
char far * far *Text,
WORD MaxLength,
TIMEDATE far *retTIMEDATE);

Especially the pointer to pointer of Text is causing me headache.

The Second Question is, how to declare a struct with string-members like:

typedef struct {
....
char TodayString[YTSTRMAX]; /* String denoting current day */
....
} INTLFORMAT

Regards,
Markward
Apr 11 '07 #1
3 2617
On Apr 11, 10:02 am, Markward Schubert
<MarkwardSchub. ..@discussions. microsoft.comwr ote:
Hi!

I wonder, how the declaration of the following c-function must look like in
VB.NET

STATUS LNPUBLIC ConvertTextToTI MEDATE(
const void far *IntlFormat,
const TFMT far *TextFormat,
char far * far *Text,
WORD MaxLength,
TIMEDATE far *retTIMEDATE);

Especially the pointer to pointer of Text is causing me headache.

The Second Question is, how to declare a struct with string-members like:

typedef struct {
...
char TodayString[YTSTRMAX]; /* String denoting current day */
...

} INTLFORMAT

Regards,
Markward
I apologize that I'm not a C programmer, so I can't help you convert
the code to VB. But I think I may still be able to help...
STATUS LNPUBLIC ConvertTextToTI MEDATE(
const void far *IntlFormat,
const TFMT far *TextFormat,
char far * far *Text,
WORD MaxLength,
TIMEDATE far *retTIMEDATE);
This turns some text (a string) into a DateTime right? If so just use
DateTime.Parse( string) instead - no need to create your own method.
The Second Question is, how to declare a struct with string-members like:

typedef struct {
...
char TodayString[YTSTRMAX]; /* String denoting current day */
While you could create a structure for this, it seems like a waste to
me. If you need a string denoting the current date just use
DateTime.Now.To String("M/d/yyyy")

Thanks,

Seth Rowe

Apr 11 '07 #2
Hi!

Thanks for your reply, but the datarype here is TIMEDATE, wich is a Lotus
Notes specific type, different from DateTime.

Regards,
Markward

"rowe_newsgroup s" wrote:
On Apr 11, 10:02 am, Markward Schubert
<MarkwardSchub. ..@discussions. microsoft.comwr ote:
Hi!

I wonder, how the declaration of the following c-function must look like in
VB.NET

STATUS LNPUBLIC ConvertTextToTI MEDATE(
const void far *IntlFormat,
const TFMT far *TextFormat,
char far * far *Text,
WORD MaxLength,
TIMEDATE far *retTIMEDATE);

Especially the pointer to pointer of Text is causing me headache.

The Second Question is, how to declare a struct with string-members like:

typedef struct {
...
char TodayString[YTSTRMAX]; /* String denoting current day */
...

} INTLFORMAT

Regards,
Markward

I apologize that I'm not a C programmer, so I can't help you convert
the code to VB. But I think I may still be able to help...
STATUS LNPUBLIC ConvertTextToTI MEDATE(
const void far *IntlFormat,
const TFMT far *TextFormat,
char far * far *Text,
WORD MaxLength,
TIMEDATE far *retTIMEDATE);

This turns some text (a string) into a DateTime right? If so just use
DateTime.Parse( string) instead - no need to create your own method.
The Second Question is, how to declare a struct with string-members like:

typedef struct {
...
char TodayString[YTSTRMAX]; /* String denoting current day */

While you could create a structure for this, it seems like a waste to
me. If you need a string denoting the current date just use
DateTime.Now.To String("M/d/yyyy")

Thanks,

Seth Rowe

Apr 11 '07 #3
On Apr 11, 10:30 am, Markward Schubert
<MarkwardSchub. ..@discussions. microsoft.comwr ote:
Hi!

Thanks for your reply, but the datarype here is TIMEDATE, wich is a Lotus
Notes specific type, different from DateTime.

Regards,
Markward

"rowe_newsgroup s" wrote:
On Apr 11, 10:02 am, Markward Schubert
<MarkwardSchub. ..@discussions. microsoft.comwr ote:
Hi!
I wonder, how the declaration of the following c-function must look like in
VB.NET
STATUS LNPUBLIC ConvertTextToTI MEDATE(
const void far *IntlFormat,
const TFMT far *TextFormat,
char far * far *Text,
WORD MaxLength,
TIMEDATE far *retTIMEDATE);
Especially the pointer to pointer of Text is causing me headache.
The Second Question is, how to declare a struct with string-members like:
typedef struct {
...
char TodayString[YTSTRMAX]; /* String denoting current day */
...
} INTLFORMAT
Regards,
Markward
I apologize that I'm not a C programmer, so I can't help you convert
the code to VB. But I think I may still be able to help...
STATUS LNPUBLIC ConvertTextToTI MEDATE(
const void far *IntlFormat,
const TFMT far *TextFormat,
char far * far *Text,
WORD MaxLength,
TIMEDATE far *retTIMEDATE);
This turns some text (a string) into a DateTime right? If so just use
DateTime.Parse( string) instead - no need to create your own method.
The Second Question is, how to declare a struct with string-members like:
typedef struct {
...
char TodayString[YTSTRMAX]; /* String denoting current day */
While you could create a structure for this, it seems like a waste to
me. If you need a string denoting the current date just use
DateTime.Now.To String("M/d/yyyy")
Thanks,
Seth Rowe
Sorry about that - I was assuming the timedate was the C type for
datetime. I'm guessing that Lotus Notes has an SDK available for
VB.Net? If it does check to see if it exposes the TIMEDATE type,
because then you may be able to cast the datetime into the timedate
using DirectCast or CType.

Thanks,

Seth Rowe

Apr 11 '07 #4

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

Similar topics

4
3806
by: William Stacey | last post by:
Using the following struct def, how can I tell (using reflection) if "ba" has the marshal attribute and get the "ByValArray" and maybe even the size? In the bigger picture, given a struct (or a class), how to decide if "sizeof(MyStruct)" would fail before calling sizeof and having to use Marshal.sizeof? TIA public struct MyStruct {
13
2152
by: Just Me | last post by:
The following almost works. The problem is Marshal.PtrToStringAuto seems to terminate at the first null so I don't get the full string. Any suggestions on how to fix this? Or how to improve the code? Thanks PS I added the +1 because as I understand the GetLogicalDriveStrings doc
21
2546
by: Mike | last post by:
Hi, The example below shows that result of a marshaled data structure is nothing but a string >>> data = {2:'two', 3:'three'} >>> import marshal >>> bytes = marshal.dumps(data) >>> type(bytes) <type 'str'>
6
2711
by: william.thorpe.b | last post by:
I have recently switched from VS2003 to VS2005 and at the same time from V1 to V2 of the .NET Compact Framework. The target is a Windows CE 5.0 device and an ARMV4I processor. System.Runtime.InteropServices.Marshal.WriteInt32 used to work fine but now is misbehaving. I wrote some native-code (C++) alternates to some Marshal methods and...
2
1895
by: Pierre Rouleau | last post by:
Hi all, When using Python 2.4.x on a Win32 box, marshal.loads(marshal.dumps(1e66666)) returns 1.0 instead of infinity as it should and does under Python 2.5 (also running on Win32 ). This problem was reported in another thread here by Peter Hansen...
5
1980
by: Anurag | last post by:
I have been chasing a problem in my code since hours and it bolis down to this import marshal marshal.dumps(str(123)) != marshal.dumps(str("123")) Can someone please tell me why? when str(123) == str("123") or are they different?
2
7189
by: O.B. | last post by:
When using Marshal to copy data from a byte array to the structure below, only the first byte of the "other" array is getting copied from the original byte array. What do I need to specify to get Marshal.PtrToStructure to copy the all the data into the "other" array? unsafe public struct DeadReckoning {
0
2111
by: Charming12 | last post by:
Hi All, I have a strange problem and due to my inefficiency with IntPtr i am unable to figure it out. I have an structure something like: public struct Detail { public int age; public Detail(int _age)
0
2718
by: xrxst32 | last post by:
Hello there, I have some doubts about the best practice for using COM automation, the Runtime Callable Wrapper (RCW) and Marshal.ReleaseComObject. So the question is/are: Do I need to release each COM object explicit by a call to Marshal.ReleaseComObject, does the RCW take care of that or does it leaks unmanaged resources?
2
15912
by: O.B. | last post by:
I have operation within a class that marshals the data into a byte array. Below are three different ways that work. Are there any downsides to using one over the the other? public virtual byte ToRaw1() { byte byteArray = new byte; IntPtr pointer = Marshal.AllocHGlobal(Size); Marshal.StructureToPtr(this, pointer, false);...
0
7512
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7438
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
5082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
751
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.