|
in here we are dealing with SAP Business Objects(BO).
Here the indices start from 1.
so an index of 0 gives index out of range exception.
|
|
|
|
|
Any reason you're asking this question in a C# forum then?
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
I didn't get the appropriate forum in which i could ask this question.
|
|
|
|
|
You should probably try somewhere like BOB[^] or an appropriate Tek-Tips[^] board.
Please respect the Forum subject, thanks.
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
I never used SAP Business Objects, so I won't be able to help any longer.
What I would do, if I were you, is to find whereas :
- the problem is on the reportAppFactory variable (which wouldn't be of type needed)
- or the problem is on the first parameter of the OpenDocument method (maybe try with infoObject instead of infoObject.ID, as it seems this method expects an object as its first parameter)
But these are only educated guesses and could be completely wrong as I'm not a SAP BO specialist.
Good luck.
modified on Tuesday, September 7, 2010 10:16 AM
|
|
|
|
|
The documentation of that OpenDocument function seems to be very low quality. According to the stack trace ("OpenDocument(Object DocID, Int32 Options) "), the first parameter is an Object , but obviously the function requires an object implementing a specific interface...
|
|
|
|
|
Hi
I am writing a C# app that talks TCP/IP to a development board. The board has C command struct packets defined below.
#define MAX_PACKET_PAYLOAD 1024
typedef enum packetCmds_enum {
PC_TO_DSP_WRITE = 1,
PC_TO_DSP_READ = 2,
DSP_TO_PC_ACK = 3
}packetCmds_enum;
//@brief This packet is sent from the DSP to the PC as a command.
typedef struct cmdPacket_type {
packetCmds_enum cmd; //< Should be 32 bits
Uint32 size; //< Set to zero if no data
Uint32 addr; //< Target address
Uint8 data[MAX_PACKET_PAYLOAD];
Uint32 checksum; //< Includes cmd, size, addr and data.
} cmdPacket_type;
I started programming it as public struct but then ran into an issue with the Uint8 data array. If I use
byte[] data = new byte[MAX_PACKET_PAYLOAD]
then I won't get the same structure because its an object.
I'm also using the System.NET.socket library to get the packet from the board.
socket.Receive(bytesReceived)
I've learned that I can't typecast bytesReceived to cmdPacket_type, so whats the cleanest way for me to parse the packet?
I also have to send packets to the dev board, but once I understand the conversion between un-managed and managed code (if thats even possible), I should be able to figure it out.
Thanks
Cheers
|
|
|
|
|
Hi,
here is a partial answer for you:
1.
in order to call native (or unmanaged) code from C#, you need P/Invoke. It isn't very simple, however there is a lot of information available, use Google. I have an unfinished article here[^]. Unfortunately for you, structs will be handled in part 2, which isn't available yet.
2.
to mimic native numeric arrays (with a constant size) in a C# struct, you need MarshalAttribute; it may look like:
struct ... {
...
[MarshalAs(UnmanagedType.ByValArray, SizeConst=1024)]
byte[] byteArray;
...
}
|
|
|
|
|
From the information you've supplied, this looks like it should work:
using System.Runtime.InteropServices;
public enum PacketCmds
{
PC_TO_DSP_WRITE = 1,
PC_TO_DSP_READ = 2,
DSP_TO_PC_ACK = 3
}
[StructLayout(LayoutKind.Sequential)]
public struct CmdPacketType
{
public const int MAX_PACKET_PAYLOAD = 1024;
public PacketCmds cmd;
public uint size;
public uint addr;
[MarshalAs(UnmanagedType.ByValArray, ArraySubType=UnmanagedType.U1, SizeConst=MAX_PACKET_PAYLOAD)]
public byte[] data;
public uint checksum;
}
|
|
|
|
|
Instead of PInvoke, I recommend to use a C++/CLI wrapper. Easy to implement and it has less "magic" involved.
|
|
|
|
|
hi guys
i can send file with bluetooth from pc to any phone with inthehand library that phone must be accept recive file
and now how to send file without accepting from phone ?
thanks a lot
|
|
|
|
|
Why do you want to do that? I wouldn't like my phone receiving a file without me knowing about and accepting it. Sounds fishy.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
thanks for reply
i want to send file from pc to phone with bluetooth without accepting from phone and when send directly send to phone
thanks a lot
|
|
|
|
|
I don't think you can, and even if it is possible, you shouldn't.
|
|
|
|
|
For what I understand, you cannot get around that limitation for, rather obvious, security reasons.
|
|
|
|
|
if you want to send to your own phone, create a solid connection maybe it can do, but i dont want to recieve your files without my "YES".
|
|
|
|
|
i would like to write control like IE-8 address bar - with the option of auto-complete text and with the option of the delete (like the X that appear on the right of each option when doing hover)
how can i add the delete option?
any idea?
Thanks
|
|
|
|
|
You'll need to subclass a ComboBox, set the autocomplete stuff and set the DrawMode to one of the OwnerDraw ones so you can draw the image and override OnDrawItem .
|
|
|
|
|
the droped-down part is more like a listview than an item of combobox, so i think you can try to implement it by a listview, refer to source code of "ObjectListView2008"(google and download it).
|
|
|
|
|
If you're using WPF you can add one of the panels as an item. That panel can contain a textbox and an icon.
Still not easy as there will be some squirks, but it's an idea.
V.
|
|
|
|
|
Hi
How can I draw Line in background of richtextbox ?(something like handwriting notebooks) even in with spaces also.
somthing like this :
1.this is my book ___________________________________________________
2.My Name : _________________________________________________________
3.My Address : ______________________________________________________
|
|
|
|
|
The easiest way probably is by using the underline font style while adding text and/or spaces.
|
|
|
|
|
Yeuch! I hate it when you have to do that, when you change the font size or text all the alignment goes out unless you use a non-proportional font. Which looks tatty. I don't have a better solution (other than "don't do it") but it is still a nasty solution.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
I almost never use underline style, and I would expect it not to mess up horizontal alignment (if any) as there is no reason I can think of it would change character widths.
I agree it isn't a really elegant solution, however drawing real lines and get them align somehow with text probably is quite a task.
BTW: I hate forms with full lines where I'm supposed to write, a subtle gray dotted line is much better. I think I left that as homework.
|
|
|
|
|
Please help and give me sample
I need it very much
Thanks\
|
|
|
|