|
Don't you think embedding all files in a dll will bloat it? I would say a zip file is a better alternative.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
You're right, it is uncompressed and the dll size will be the sum of the individual files plus a small overhead. I have found a limit of the technique when attempting to create a dll with some large files as somewhere between 400 and 600MB when the compiler gave up.
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.error CS0016: Could not write to output file 'e:\VC\Projects\CodingTests\BinaryResource\resourcelib.dll' -- 'Not enough storage is available to complete this operation. '
Alan.
|
|
|
|
|
To me it sounds like your best bet is to manually create an installer. You'll have to use the resource API, and file management functions, such as CreateFile. Those two sets of libraries should help you accomplish your goal.
This isn't for the purpose of executable security (File integrity) or Intellectual Property protection, is it? If so, I would recommend looking into obfuscation, using techniques such as code virtualization and runtime integrity checks.
|
|
|
|
|
We all know that DataTables can't be passed through a webservice because it is not serializable.
Then how typeof(DataTable).IsSerializable is true?
|
|
|
|
|
typeof(DataTable).IsSerializable is true because it's marked with the SerializableAttribute[^]
The SerializableAttribute tells the serializer to use default serialization, but the serializer will throw an exception if it encounters a type which isn't marked with the SerializableAttribute. The DataTable Columns property is of the type DataColumnCollection[^] which is not marked with the attribute and thus DataTable cannot be serialized.
But DataSet can be serialized and it contains DataTable 's!
The reason DataSet can be serialized is because it implements the ISerializable interface[^] and thus custom serialization logic.
|
|
|
|
|
dews turner wrote: We all know that DataTables can't be passed through a webservice
I don't know that; I've never tried it.
|
|
|
|
|
Well now you do, so maybe now we all know it
|
|
|
|
|
I don't know it until I try it myself; I don't just believe spurious rumors on the 'Net.
|
|
|
|
|
I had no idea! I never actually tried. It's been years since I used webservices, but I think I remember using DataSets.
Learn something every day, thanks!
|
|
|
|
|
I m trying to fire click event of two dynamic tabcontrols. i am not able to fire click event in the first asign tabcontrol. (without array)
Public Class Form1
Friend WithEvents MaxTab As DevExpress.XtraTab.XtraTabControl
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
MaxTab = New DevExpress.XtraTab.XtraTabControl
MaxTab.Name = "tabd"
MaxTab.Top = 1
MaxTab.Size = New System.Drawing.Size(Me.Width - 15, Me.Height - 80)
MaxTab.TabPages.Add("dTAB1")
MaxTab.TabPages.Add("dTAB2")
AddHandler MaxTab.Click, AddressOf MaxTab_Click
Me.Controls.Add(MaxTab)
MaxTab = New DevExpress.XtraTab.XtraTabControl
MaxTab.Name = "tabr"
MaxTab.Top = 1
MaxTab.Size = New System.Drawing.Size(Me.Width - 15, Me.Height - 80)
MaxTab.TabPages.Add("rTAB1")
MaxTab.TabPages.Add("rTAB2")
AddHandler MaxTab.Click, AddressOf MaxTab_Click
Me.Controls.Add(MaxTab)
Me.Controls("tabr").Visible = False
Me.MaxTab.Refresh()
End Sub
Private Sub MaxTab_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MaxTab.Click
MessageBox.Show(MaxTab.SelectedTabPage.Text)
End Sub
End Class
|
|
|
|
|
You are mixing different ways of event handling here.
To avoid confusion, now and later on, remove the MaxTab variable altogether, use AddHandler to register for events, and do not use the Handles statement.
So:
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim TabCtrl As DevExpress.XtraTab.XtraTabControl
TabCtrl = New DevExpress.XtraTab.XtraTabControl
TabCtrl.Name = "tabd"
TabCtrl.Top = 1
TabCtrl.Size = New System.Drawing.Size(Me.Width - 15, Me.Height - 80)
TabCtrl.TabPages.Add("dTAB1")
TabCtrl.TabPages.Add("dTAB2")
AddHandler TabCtrl.Click, AddressOf MaxTab_Click
Me.Controls.Add(TabCtrl)
TabCtrl = New DevExpress.XtraTab.XtraTabControl
TabCtrl.Name = "tabr"
TabCtrl.Top = 1
TabCtrl.Size = New System.Drawing.Size(Me.Width - 15, Me.Height - 80)
TabCtrl.TabPages.Add("rTAB1")
TabCtrl.TabPages.Add("rTAB2")
AddHandler TabCtrl.Click, AddressOf MaxTab_Click
Me.Controls.Add(TabCtrl)
Me.Controls("tabr").Visible = False
End Sub
Private Sub MaxTab_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ClickedTab As DevExpress.XtraTab.XtraTabControl = sender
MessageBox.Show(ClickedTab.SelectedTabPage.Text)
End Sub
End Class
If you need to be able to easily access the tabs later on, create a list/collection variable at class-level instead and add each new tab control to the list.
I.e. add:
Friend TabControls As List(Of XtraTabControl) = New List(Of XtraTabControl)
TabControls.Add(TabCtrl)
|
|
|
|
|
please help me how to make a video themes in desktop ang how to connect the weather in vb.net thanks
|
|
|
|
|
Your question is a bit mashed up and unclear, but all I can establish is your trying to make a gadget to pull the weather from somewhere?
1) have you read the documentation? Developing a Gadget for Windows Sidebar Part 1: The Basics[^]
2) I have made a CodeProject gadget, Windows 7 Sidebar Gadget - CodeProject Reputation Watcher[^], you might want to look at how I have done that.
3) Gadgets are zip files, you could always take a peek inside the current windows weather gadget and see how they have built it. Have a look in the Program Files | Windows Sidebar | Gadgets folder, and then look at the internals of the Weather.Gadget
|
|
|
|
|
i
t not the project i am taking about
i need to improve the gadgets.. it like a video desktop if the weather is sunny day the desktop will play a video for sunny day...that why i need to connect my vb.net to internet...
thank you so much
|
|
|
|
|
hi guyz im trying to work with code searching using textbox and listview in vb.net as what i did in vb6
example: here's my data in listview
Apple
Orange
Grapes
in vb6, when im going to put something in textbox like "a" automatically the apple will be selected and highlighted and still my cursor is still in my textbox or lets just say, the focus is still in textbox
unlike in vb.net, here's my code:
Dim foundItem As ListViewItem = _
lvUser.FindItemWithText(searchBox.Text, True, 0, True)
If (foundItem IsNot Nothing) Then
lvUser.TopItem = foundItem
Else
MsgBox("No Record Found!")
End If
when im going to type like "a", nothings happen. it will not highlight the row as what ive expected. when im going to put like lvUser.Items(0).Selected = True, yes it will but the problem is the focus will be in the listview.. do you have any idea? thanks and God bless
|
|
|
|
|
You're assuming that the FindItemWithText method will show the item found. It doesn't. All it does is what it's name suggests, find and item and return it to your code, which BTW, your ignoring the returned item!
If you want to see that item in the ListView, you have to pass the returned item to the ListView EnsureVisible method.
|
|
|
|
|
I was looking at sorting some strings today and noticed that the default comparer orders them wrong -- it sorts "a" before "A", rather than after it, for instance.
So I looked into it and read up a bit and tried the InvariantCulture and the Ordinal comparer -- Ordinal works correctly, and I'll likely use it, but I'm not happy about it.
According to http://msdn.microsoft.com/en-us/library/dd465121.aspx[^]:
"Comparisons that use StringComparison.InvariantCulture and StringComparison.Ordinal work identically on ASCII strings."
Which is not strictly true -- they order these differently.
Does anyone here know how to make a Culture (based on en-US) that does a case-sensitive sort the right way?
Edit: This is interesting... I was experimenting with the System.StringComparer.CurrentCultureIgnoreCase and discovered that it seems to do what I want -- at least in the tests I've made. Which is good.
But that means that it doesn't actually ignore the case!
Scratch that -- it's just an artifact of how I was testing it.
modified on Friday, August 19, 2011 2:13 PM
|
|
|
|
|
One way is to put each characters into an array and the sort the array.
Second option is: convert each chars of string to ASCII value. Sort the value and then reconvert it to chars. Finally, merge the chars. You will get the sorted string.
|
|
|
|
|
That's equivalent to what the Ordinal comparer does. And I'm not sorting a string, I'm sorting a collection of strings.
|
|
|
|
|
Ordinal does an ASCII compare.
PIEBALDconsult wrote: I'll likely use it, but I'm not happy about it
Not happy about what?
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
About having to use the Ordinal comparer to get the correct (desired) case-sensitive sort order.
I should be able to use a "linguistic" (I think that's the term the documentation used) Culture that produces the same sort order of ASCII data.
And if I can create a Culture that does that and set it as my CurrentCulture, so much the better.
|
|
|
|
|
PIEBALDconsult wrote: I should be able to use a "linguistic" (I think that's the term the documentation used) Culture that produces the same sort order of ASCII data.
Different languages treat upper and lower case differently. While English considers a lowercase 'a' to be semantically "less than" the uppercase 'A', it may not be the same with other languages. I think that's why the designers of .NET chose to give us the language-neutral Ordinal option.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Shameel wrote: English considers a lowercase 'a' to be semantically "less than" the uppercase 'A',
Got a reference for that? I think the opposite is true.
|
|
|
|
|
PIEBALDconsult wrote: Got a reference for that?
I don't have a reference, but working with customers, they like to see 'A' on top of lists and 'a' below that.
PIEBALDconsult wrote: I think the opposite is true.
The opposite is true in case of ASCII.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Shameel wrote: they like to see 'A' on top of lists and 'a' below that.
Exactly. That's how I want it, and the Ordinal comparer does it, but the InvariantCulture (and en-US) does it the other way.
Edit: Well not exactly, come to think of it, because the Ordinal comparer also say "Z" < "a", which I don't want.
modified on Friday, August 19, 2011 12:15 PM
|
|
|
|