|
You have no clue how Windows Networking works, do you? There is no code sample because you cannot map a drive to anything other than a shared folder.
|
|
|
|
|
Ok, thanks for your explanation.
|
|
|
|
|
How about if i build server component using vb 6 or microsoft access form? Could you give me a sample to do that?
modified on Wednesday, March 23, 2011 10:33 PM
|
|
|
|
|
No. I haven't touched VB6 in over 10 years.
I got my hands on VB.NET when .NET was a Beta and haven't looked back since.
If you have to make a server component just because you want to use Access, you're in deep trouble. Move to a database engine that supports this already, such as SQL Server, Oracle, MySQL, whatever... Access is probably the only database engine that doesn't support what you want to do, so why waste the effort on it?
|
|
|
|
|
|
Hi everybody,
I'm trying get my byte array into a structure successfully with the following code. Unfortunately I have no idea how to consider endianness of the data - I'd need the bytes swapped!
<StructLayout(LayoutKind.Sequential, Pack:=1)> _
Public Structure FILEHEADER
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=4)> Dim magic As String
Dim offset As UInt32
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=8)> Dim version As String
Dim fileSize As UInt32
Dim dittoKey As UInt32
Dim genericSize As UInt32
Dim industrySize As UInt32
Dim userSize As UInt32
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=100)> Dim fileName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=24)> Dim timedate As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=100)> Dim creator As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=200)> Dim project As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=200)> Dim copyright As String
Dim encryptKey As UInt32
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=104)> Dim Reserved As String
End Structure
Sub Main()
Dim fh As FILEHEADER = New FILEHEADER
ByteArray = GetBytesFromFile(myFile)
Dim MyGC As GCHandle = GCHandle.Alloc(ByteArray, GCHandleType.Pinned)
fh = DirectCast(Marshal.PtrToStructure(MyGC.AddrOfPinnedObject, GetType(FILEHEADER)), FILEHEADER)
MyGC.Free()
Console.WriteLine("Magic:" & fh.magic)
Console.WriteLine("Offset:" & fh.offset)
Console.WriteLine("Version:" & fh.version)
Console.WriteLine("File Size:" & fh.fileSize)
Console.WriteLine("Ditto Key:" & fh.dittoKey)
Console.WriteLine("Generic Size:" & fh.genericSize)
Console.WriteLine("Industry Size:" & fh.industrySize)
Console.WriteLine("User Size:" & fh.userSize)
Console.WriteLine("File Name:" & fh.fileName)
Console.WriteLine("Time-Date:" & fh.timedate)
Console.WriteLine("Creator:" & fh.creator)
Console.WriteLine("Project:" & fh.project)
Console.WriteLine("Copyright:" & fh.copyright)
Console.WriteLine("Encrypt Key:" & fh.encryptKey)
Console.WriteLine("Reserved:" & fh.Reserved)
Console.WriteLine(StrDup(30, "-"))
'Console.WriteLine("actFlatAct:" & String.Concat((From s In fh.ActFlatAct Select s.ToString("f2") & " ").ToArray))
Console.WriteLine("FILEHEADER size:" & Marshal.SizeOf(fh))
Console.ReadKey()
End Sub
Does anyone have an idea how to get the bytes in the swapped endian order?
Thanks for your hints!
Mick
|
|
|
|
|
The marshaler doesn't support changing the byte order, so you'd have to do it yourself with a Custom Marshaler[^].
|
|
|
|
|
Thank you for making that clear, Dave. Would you think, considering overall performance, that the effort of custom marshalling makes sense at all then? I have a byte array in the wrong endian order, and might as well swap and assign the bytes to my structure within a loop.
|
|
|
|
|
I didn't know if you had contorl over that, but yes, that would work too.
|
|
|
|
|
Can I export to OpenOffice from DataGridView? I can export to MS Word and MS Excel.
|
|
|
|
|
There is this[^] pdf file which is in c#, if you are able to translate.
If not, I used c# openoffice interop as my search phrase, just substitute 'vb' for my 'c#' and see what you get. Bound to be something useful.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
ivo75 wrote: Can I export to OpenOffice from DataGridView? I can export to MS Word and MS Excel
Yes. You can probably open the files that you're generating for Word and Excel using OpenOffice Writer and Calc.
I are Troll
|
|
|
|
|
OK but can I export to word or excel without word or excel in my PC.
|
|
|
|
|
Yes, by exporting as RTF and CSV respectively. OpenOffice knows both formats too. Exporting to CSV is most easily done using a OleDb connection.
I are Troll
|
|
|
|
|
|
No. Without Word or Office installed, you cannot export to one of the Office native formats without Office installed.
Well, maybe. If you're trying to export to Office 2003 native formats, you'd have to find a third party library that can write those formats.
For Office 2007 and above, you can go through some of this[^] since Microsoft abandoned the proprietary formats and adopted an open XML file format instead.
|
|
|
|
|
..simply say "no", as the next question is going to be why it can't read Excel-files from Office 95/97
I are Troll
|
|
|
|
|
Is proprietary. Means you'll need the software installed, just as if it were a regular application like Autocad. Or go for OpenXML
I are Troll
|
|
|
|
|
Yes
see here[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hello everybody,
I have a byte array holding a (non-windows) bitmap format (RGB as 10 bits each in a UInt32). In order to change it to a visible 8-bit image I have to do some bit-shifting on the pixels, but unfortunately looping through the pixels with
Dim RGBArray(CInt((PicFile.Length - ft.Position) / 4 * 3) - 1) As Byte
For i = 0 To (RGBArray.Length - 1) Step 3
' change Endianness
Dim buff As UInt32 = EndianConversion.SwapDWORD(brh.ReadUInt32)
' bit-shifting operation
RGBArray(i) = (buff And &HFFC) >> 4 ' Blue
RGBArray(i + 1) = (buff And &H3FFFFC) >> 14 ' Green
RGBArray(i + 2) = (buff And &HFFFFFFFC) >> 24 ' Red
Next i
takes a lot of time. Having seen how images can be manipulated with an image matrix, I wonder if that kind of operation might also be performed using a matrix on the whole byte array?
Is someone around who can tell me this or a faster way to get my image as bitmap?
Thanks
Mick
|
|
|
|
|
IMO existing code, such as GDI+, will not do format conversions for you. Its matrix operations preserve the pixel format, all they do is multiply and/or add pixel values and matrix coefficients, not bit masking or shifting.
There are a few optimizations you could apply to your code; in particular you should avoid calling methods for each and every pixel (RGBArray.Length, SwapDWORD, ReadUInt32); replace them by local variables, local code, and larger moves (say a scanline at a time).
FWIW: languages that don't support pointers (such as VB.NET) aren't as good as C/C++/C# for image processing.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thank you, Luc.
Actually, I didn't think existing code would cover what I need. Basically I wanted to know if bit-shifting can be done with a matrix at all. If yes, the next step would of course be to ask how such a custom matrix would be coded.
Luc Pattyn wrote: replace them by local variables, local code, and larger moves (say a scanline at a time)
Ok, replacing the array's length was easy and I hope I replaced the byte-swapping properly by reversing the whole byte array (Array.Reverse(RGBArray)). What I don't quite understand is how you would address "a scanline at a time" and still get the right RGB values for each and every single pixel?
|
|
|
|
|
you should load a number of pixels into a local array, not call them one by one. So replace readUint32 by whatever fits the situation.
I did not suggest you reverse an entire array, that is an expensive operation (especially if the image size exceeds the L2 cache size) that doesn't raise the intrinsic value of your data. What I would consider is calculating each pixel component from the exact two bytes that hold its bits.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I want to change the verion number of XLA project,this is existing project
please help me thanks
|
|
|
|
|
1) Double Click 'My Project' in 'Solution Explorer' pane.
2) On the 'Application Tab' click the 'Assembly Information' button.
3)Set new version number as required.
Or, Right Click the Top Level Project Node and Select Properties, perform steps 2 and 3 above
Or, from the Project Menu select 'AddinName' Properties, perform steps 2 and 3 above
|
|
|
|