|
I am not sure what you are trying to achieve, but the types of files you are talking about wouldn't have a text encoding. They are straight 8 bit with no encoding.
|
|
|
|
|
Thanks for the tips
BTW what's mean UTF-7 UTF-8 ??
is it something like UNICODE TEXT FORMATTER ?
thanks again
|
|
|
|
|
Yes. If you do a search in MSDN you will get an abundance of information.
Regards
|
|
|
|
|
I search MSDN and the error I got in my program what reliated to UTF-16 so UnicodeEncoding but it's not working anyway. I don't know why I got this error because If i test it on multiple files like TXT Files I don't have any trouble but when i'm talking about EXE and Archive i got error. That Strange !!
anyway if anybody have the answer or if you want me to send you my sample, just beep me
jonathan.pouliot@tecksys.com
ICQ : 71682311
Thanks
|
|
|
|
|
Sure, send a sample, and I will get it to work.
The statement in your original post, "I created a multiple file tools" didn't give me a lot of insight on what you are trying to achieve, sorry.
Email: vannote@netaxs.com
Regards
|
|
|
|
|
I've really tried to make sense out of the extender provider samples, but not a one of them does the same way, and none of them are relatively trivial. What I am looking for is the ability to add one simple 'boolean' to every object on my form.
Sounds simple... So what am I doing wrong?
I added on a project to my main application and created a component of out this. I can get it to show up, but in no combination of aggravation can I make the boolean property appear on the controls.
Can anyone help me out!
Thanks!!
----------------------------------------------
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace StatusMessage
{
[ProvideProperty( "StatusMessage", typeof( Object ))]
public class StatusMessaging : Component, IExtenderProvider
{
private bool bUpdateStatusBar = false;
[DefaultValue(false)]
public bool GetStatusMessage( Control pControl )
{
return bUpdateStatusBar;
}
public void SetStatusMessage( Control pControl, bool value )
{
bUpdateStatusBar = value;
}
public bool CanExtend( object pControl )
{
if( pControl is Component ) return true;
else return false;
}
}
}
|
|
|
|
|
Let me update the code. After 300 iterations, it just didn't look right
namespace StatusMessage
{
/// <summary>
/// Summary description for UserControl1.
/// </summary>
[ProvideProperty( "StatusMessage", typeof( bool ))]
public class StatusMessaging : Component, IExtenderProvider
{
/// <summary>
/// Required designer variable.
/// </summary>
protected bool bUpdateStatusBar = false;
public bool GetStatusMessage( Control pControl )
{
return bUpdateStatusBar;
}
public void SetStatusMessage( Control pControl, bool value )
{
bUpdateStatusBar = value;
}
public bool CanExtend( object pControl )
{
if( pControl is Control )
return true;
return false;
}
}
}
|
|
|
|
|
psdavis wrote:
[ProvideProperty( "StatusMessage", typeof( bool ))]
Try making it typeof(Control). You need to tell the UI what type of objects you want the property to appear for. It works out the type your property will provide from the GetStatusMessage and its return type.
I can send you an example I have that I wrote which provides a simple extender to a control. I was going to write it up as an article, but I dont haev time.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Suppose someone were writing a "firewall" application that was "watching" or listening for activity over an incoming IP address, what is the best way to cover all ports. In all the examples I have read, someone creates an instance of TcpListener and supplies a port to listen to. Surely you don't have to do that for each of the 65,000+ ports. Could someone lead me in the right direction. Thanks.
Nick Parker
|
|
|
|
|
There is probably some winsock/system hook buried somewhere deep in the win32 API, that tells you when there is an inbound connection request.
I looked at SetWindowsHookEx but it didn't seem to offer it, and I didn't see anything in the WinSock API. Perhaps someone more knowledgeable than me can fill you in, in the VC++ forum.
Once you find it, you can use P/Invoke to access it. Or at the most you would have to write a MC++ layer to act as the middleman for your C# code and the system.
Good Luck,
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
James T. Johnson wrote:
There is probably some winsock/system hook buried somewhere deep in the win32 API
So you think a system hook is the way to go??
This might be a great article idea, when I find more time/information I will post something, I tried the VC++ forum but only got one response that was unfortunately no help. I'll keep searching
Nick Parker
|
|
|
|
|
Hi!
what I want to make....
when an user checked one item in the ListView the other items must come
hidden.
or:
when an user checked one item in the ListView the other items must come
hidden and after the user cheched the second time
at this item all items was visible....
(I will make it to allowed the user to checked only 1 item)
have anyone an idea how I can make this?
(at best would help me a code sample in C#)
big THX!!
|
|
|
|
|
How Can I make my own self extractor without using any zipping lib, I just want to add multiple file to an exe and when I double click on this exe : show a dialog with a browse to folder where the user want to extract files ???
Thanks
|
|
|
|
|
You could add each file as a resource to an executable, then use the Assembly.GetManifestStreamNames/Assembly.GetManifestStream methods to loop through all the files added as resources parsing the name to determine if a folder should be created (or adding a special file which contains that data).
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
do you have sample code or articles on the subject because I don't know how play with Manifest( I don't know what is it) and I don't know how play with asssembly
??
thanks a lot
|
|
|
|
|
I'll get right on it
Actually I'll 'get right on' finding my code and tweaking it
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I've uploaded a sample program that (by default) has two files embedded in it; it uses the FolderBrowser component from CP, and it just happens that that component is what I embedded in the exe.
AssemblyManifest.zip I've included the VS.NET project and a batch file to build it from the command line if you don't have VS.NET
Good Luck,
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
Thanks a lot, you're my god
btw do you have ICQ if yes here's my pin :71682311
thanks again
|
|
|
|
|
I have ICQ but its closed most of the time, I only talk to 2 people on it anymore and one of them is in an IRC channel with me and the other doesn't get on much :-P
I'm trying to switch over to sonork full time
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
Use your mouse to go over any menu item on any program. The status bar updates automatically with a description that you've added.
How do you do it with C#?
Thanks!!
|
|
|
|
|
Handle the Select event of the MenuItem and just set the status bar text (or anything else) as you wish.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Yep, that definitely helps. Is there any way of doing it automatically (as I'm used to in MFC)?
Or do I have to make one gigantic 'if' statement with the text that I want to display?
|
|
|
|
|
I dont know about doing it automatically, but you could always create your own derived MenuItem class, or an ExtenderProvider that would do it.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
True, I saw some examples in Petzold. But then wouldn't you loose the capability of using the IDE to create your menus?
I currently have the following code snippet for the display on the status bar.
private void MenuLoad_Select(object sender, System.EventArgs e)
{
MenuItem oMenuItem = sender as MenuItem;
if( oMenuItem != null )
{
switch( oMenuItem.Text )
{
case "&Open":
StatusBarMessage.Text = "Open up the file";
break;
case "&Save":
StatusBarMessage.Text = "Save the file to the disk";
break;
}
}
}
|
|
|
|
|
If you are overriding the menus but not any of the drawing code (DrawItem and MeasureItem) then I would guess that the IDE should handle it, but I dont know. Try it and find out.
An extender provider would certainly not affect the IDE.
Probably the easiest way to do this would just be to buildup a collection of messages. This saves the interface, but doesnt allow you to set the menu help text in the forms designer.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|