|
You could also have a third exe on your flash drive that, when loaded, copies the "real" exe to your temp directory on the local computer, then instantiates that executable. This coupled with the idea presented by a previous poster (the person who suggested a small loader program on your hard drive to load the other into memory) should minimize temp filespace, prevent the actual executable from being saved on the HD, AND prevent the user from needing to manually copy the executable from the flash drive to the HD. Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
|
The background is that I am designing a custom event which is a new thing for me.
I have a piece of code that is not consuming an event which I am puzzled with.
I can see the heardPhrase event being raised using the degugger.
However the CommandHeard method never gets called.
Now I tried the same piece of code using static methods etc in another piece of code and everything was ticketyboo.
Any help, clues gratefully received.
public Listen listen = new Listen();
public MainForm()
{
listen.heardPhrase += new Listen.ListenEventHandler(CommandHeard);
}
public void CommandHeard(object sender, ListenEventArgs e)
{
lstCommands.SelectedIndex = e.PhraseIdx;
}
You always pass failure on the way to success.
|
|
|
|
|
GuyThiebaut wrote: I can see the heardPhrase event being raised using the degugger.
We can't see it because you didn't post that code and point to where your breakpoint is set.
led mike
|
|
|
|
|
Just solved it.
Basically the event handling class needed satanic static members and methods so the following failed:
public class Listen
{
public delegate void ListenEventHandler(object sender, ListenEventArgs e);
public event ListenEventHandler heardPhrase;
public void Heard(int p)
{
ListenEventArgs sp = new ListenEventArgs(p);
heardPhrase(null, sp);
}
}
This worked:
public class Listen
{
public delegate void ListenEventHandler(object sender, ListenEventArgs e);
public static event ListenEventHandler heardPhrase;
public static void Heard(int p)
{
ListenEventArgs sp = new ListenEventArgs(p);
heardPhrase(null, sp);
}
}
You always pass failure on the way to success.
modified on Thursday, April 3, 2008 5:20 PM
|
|
|
|
|
I want User put something like this ....
xx123xx here x is Alphabetic word
Id has to be 7 char.
first 2 char is Alphabetic
Last 2 char is alphabetic
Middle 3 to 5 char should be number....
Is tha any one can help me..
-Thanks
Peter
|
|
|
|
|
I suggest you do some research on Regular Expressions[^].
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
What exactly to u need?
To Validate that the string is in your Format?
if so just :
use the maskedTextBox and define the MAsk Property to :
aa000aa
define the MaskInputReject Event
it will check the format itself
(in the event give a message like "Wrong Format"
in a MessageBox)
Have Fun
Never forget it
|
|
|
|
|
I find maskedinputs quite buggy imo i think the more elegant solution would be regular expressions
A pessimist sees the difficulty in every opportunity; an optimist sees the opportunity in every difficulty I am a Optimist
|
|
|
|
|
gspiteri wrote: I find maskedinputs quite buggy
Welcome to VS C#, there a Lot of bugs
i did what u Thought about it's working fine
but i guess u have some other things in between
Hope i've been helpfull
Have Fun
Never forget it
|
|
|
|
|
half-life wrote: Welcome to VS C#, there a Lot of bugs
lol i hear you half-life
A pessimist sees the difficulty in every opportunity; an optimist sees the opportunity in every difficulty I am a Optimist
|
|
|
|
|
Use Regex for this.You can get many example in c#, javascript just search in google.
Sarvesh Upadhyay
Senior Software Engineer
Birlasoft India Ltd.
Microsoft Certified Professional Developer in Dotnet 2.0 Enterprise Application
|
|
|
|
|
HI,
I'm Trying to read from ini file like this :
<br />
string ToReturn = "";<br />
GetPrivateProfileString("CATEGORY1", "CATEGORY1_KEY1", "", ToReturn, 255, iniFilePath);<br />
but i get nothing
anyone?
THANKS
Have Fun
Never forget it
|
|
|
|
|
Hi,
if ToReturn is to be an output of your method, you need to use the ref or out keyword,
both where you define and where you use the method.
I suggest you read the documentation on these keywords.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
|
First, promise it's not for homework.
That's the very first thing I ever did with P/Invoke... but it was so long ago and I don't use it so I don't guarantee that my implementation is worth a darn:
[
System.Runtime.InteropServices.DllImportAttribute
(
"Kernel32"
,
SetLastError=true
,
EntryPoint="GetPrivateProfileString"
)
]
private unsafe static extern uint
API_GetPrivateProfileString
(
string lpAppName
,
string lpKeyName
,
string lpDefault
,
byte* lpReturnedString
,
int nSize
,
string lpFileName
) ;
public unsafe static int
GetPrivateProfileString
(
string lpAppName
,
string lpKeyName
,
string lpDefault
,
out string lpReturnedString
,
int nSize
,
string lpFileName
)
{
int result ;
byte[] temp = new byte [ nSize ] ;
fixed ( byte* ptemp = temp )
{
result = (int) API_GetPrivateProfileString
(
lpAppName
,
lpKeyName
,
lpDefault
,
ptemp
,
nSize
,
lpFileName
) ;
}
lpReturnedString = System.Text.Encoding.Unicode.GetString ( temp ).Substring ( 0 , result ) ;
return ( result ) ;
}
|
|
|
|
|
|
Hi,
I'm need to stress test an device that has a http interface. I created a program with the web-brower object and I can access the page. I'm having a hard time figuring out how to insert data into some forms on the webpage.
Any ideas?
Thanks!
|
|
|
|
|
Save yourself the time and get this[^]. You can script all of your testing and have as many simulated clients as you want beating up on your web app.
|
|
|
|
|
Hi,
Sorry I do not understand your question. What do you mean http interface?
|
|
|
|
|
|
So I've written a C# winform application that's supposed to be launched by an MFC application. All is working well until my boss asks if there's a way for me to lock the MFC application until my application was closed.
Since I just didn't see the possibility of reverse engineering the MFC app and gaining control from my app, my straight answer was "no" and that he should check to see if the MFC app he's using is able to launch my application and wait for it to close.
Now I'd like to keep my bases covered and make sure that I was correct here that I'm just way out of scope to be able to do anything with his app besides accept command line arguments.
|
|
|
|
|
jchalfant wrote: All is working well until my boss asks if there's a way for me to lock the MFC application until my application was closed.
The short answer is No. You have no control of another app's message pump or it's response to it.
The long answer is maybe, with a lot of research into hooking message pumps and filtering messages. I can see a bunch of potential problems doing this though.
|
|
|
|
|
|
Is there a way to retrieve the path of the .msi file programmatically that is currently being installed?
|
|
|
|