473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

What is wrong with this code please?

using System;
using System.Text;
using System.Runtime.InteropServices;

[StructLayout( LayoutKind.Sequential)]
public struct DOCINFO
{
[MarshalAs(UnmanagedType.LPWStr)]public stringpDocName;
[MarshalAs(UnmanagedType.LPWStr)]public stringpOutputFile;
[MarshalAs(UnmanagedType.LPWStr)]public string pDataType;
}

on just these:
[MarshalAs(UnmanagedType.LPWStr)]public stringpDocName;
[MarshalAs(UnmanagedType.LPWStr)]public stringpOutputFile;

I get the error at compile:
"error CS1519: Invalid token ';' in class, struct, or interface member
declaration"
Thanks,
Trint

Nov 16 '05 #1
3 934
perhaps a space between string and pDocName might help

"trint" wrote:
using System;
using System.Text;
using System.Runtime.InteropServices;

[StructLayout( LayoutKind.Sequential)]
public struct DOCINFO
{
[MarshalAs(UnmanagedType.LPWStr)]public stringpDocName;
[MarshalAs(UnmanagedType.LPWStr)]public stringpOutputFile;
[MarshalAs(UnmanagedType.LPWStr)]public string pDataType;
}

on just these:
[MarshalAs(UnmanagedType.LPWStr)]public stringpDocName;
[MarshalAs(UnmanagedType.LPWStr)]public stringpOutputFile;

I get the error at compile:
"error CS1519: Invalid token ';' in class, struct, or interface member
declaration"
Thanks,
Trint

Nov 16 '05 #2
trint wrote:
[MarshalAs(UnmanagedType.LPWStr)]public stringpDocName;
[MarshalAs(UnmanagedType.LPWStr)]public stringpOutputFile;

I get the error at compile:
"error CS1519: Invalid token ';' in class, struct, or interface member
declaration"

There should be a space between string and "pDocName" and "pOutputFile".
[MarshalAs(UnmanagedType.LPWStr)]public string pDocName;
[MarshalAs(UnmanagedType.LPWStr)]public string pOutputFile;

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
Nov 16 '05 #3
That was it...
Thanks,
Trint

Nov 16 '05 #4

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

Similar topics

1
by: learningGuy | last post by:
Can someone tell me what is wrong with this simple code? I get an exception every time at the myFile.Open() line. I have included the code that I think is needed to for you to answer this below:...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
72
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
17
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
2
by: Aaron Ackerman | last post by:
I cannot a row to this bound DataGrid to SAVE MY LIFE! I have tried everything and I am at a loss. The using goes into add mode with the add button adds his data then updates with the update...
3
by: belton180 | last post by:
CODE]../* Program function: Simulate the stack using a stack limit of 10. Display a menu for the the following. Create a stack Insert an item in the stack Pop an item from the stack ...
2
by: jakeruston | last post by:
Hi, I have coded this and it is coming up with hundreds of errors. What is wrong with this anyway? #include <iostream> #include <string> using namespace std; using std::cout;
3
by: redcodeheaven | last post by:
Hello my teacher gave me an exercise to enter my name and 2 numbers the output must show the sum and the product of these 2 numbers and keep repeating the same procedure using a while loop till i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.