|
|
Bold text is used to emphasise something. Please don't do this to everything that you write.
For a method to be able to update a string parameter, you have to use the ref keyword to send the parameter by reference.
I'm not certain if you have posted the correct VBA code. It's sending the parameter by value, which would not make it possible for the function to update the string.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Your problem may be resolved by using a StringBuilder for the result buffer and I'll point you to a reference showing the win32 api function GetWindowText which returns a string.
http://msdn.microsoft.com/en-us/magazine/cc301501.aspx[^]
[DllImport("sn25.dll", EntryPoint = "****")]
static extern int snod(string host, string port,
string user, string passwd,
string cert, string CAert,
string Nodtjänst, string arg,
string extra,
StringBuilder result, int buf);
You'd then call your function like this
StringBuilder sb = new StringBuilder(1024);
int res = snod(............, sb, sb.Capacity);
string resultStr = sb.ToString();
Also make sure that you know what type of encoding the result string uses, i.e. Ansi or Unicode and set CharSet appropriately in your DllImport attribute.
I'm not an expert at this so can't guarantee that these suggestions will work, but hopefully...
Alan.
|
|
|
|
|
I have created a widows service,register it and it is working fine.
Now i have created Windows application.RIght Click the solution and click add new item.I have added windows service compiled code and register using "installutil C:\mcWebService\bin\Debug\windowsapplication1.exe"
Now when i go to computer->manage->services and start service it gives following error
"Error: 1053 the service did not respond to the start or control request in timly fashion"
any body has solution for this
|
|
|
|
|
installutil is for Windows Services, not Windows Applications.
|
|
|
|
|
Then when we create windows aplication and right click to add new item and add windows service class then how this windows service will run
|
|
|
|
|
You either want a Windows Application or a Windows Service, you can't have something that's both.
If you want both and want them to interact, you'll need to create your own way to do that.
What are you trying to do?
|
|
|
|
|
Hello,
I am writing a regular expression to divide a CSS file into rules like this;
#DTEST
{
border-style:solid;
border-width:thin;
}
I want to repeat a part of the pattern to match all attributes enclosed between the tow braces
the pattern I want to repeat looks like this:
[\n\t\\s]*[a-zA-Z\\-]+[\\s]*:[\\s]*[a-zA-Z\\-]+[\n\t\\s]*
Dad
|
|
|
|
|
|
I want to repeat a part of the pattern to match all attributes enclosed between the two braces
the pattern I want to repeat looks like this:
[\n\t\\s]*[a-zA-Z\\-]+[\\s]*:[\\s]*[a-zA-Z\\-]+[\n\t\\s]*
How to repeat this pattern? this pattern allows application to validate only one attribute
like this
color:red;
but if there is a lot of attributes i don't know
How to make the pattern match them all?
Dad
|
|
|
|
|
Regex.Matches returns a MatchCollection , if more than one match is found. I don't see your problem!?!
|
|
|
|
|
Here you go, I even tested it for you...your pattern appears to work fine and dandy:
string input = @"#DTEST
{
border-style:solid;
border-width:thin;
}";
string pattern = "[\n\t\\s]*[a-zA-Z\\-]+[\\s]*:[\\s]*[a-zA-Z\\-]+[\n\t\\s]*";
MatchCollection mc = Regex.Matches(input, pattern, RegexOptions.Multiline | RegexOptions.IgnoreCase);
Console.WriteLine(mc.Count);
foreach (Match m in mc)
{
Console.WriteLine(m.Value.Trim());
}
|
|
|
|
|
Thanks a lot,
I know that the pattern works well in the way you use it for getting the attributes inside
these two braces {} but what I've failed to do is to match the whole rule like this:
#DTEST
{
border-style
: solid ;
border-width : thin ;
position:relative;
right:10px;
left:900px;
width:50px;
}
This is the whole pattern:
[\\.#]?[a-zA-Z0-9_]+[\n\t\\s]*{[\n\t\\s]*[a-zA-Z\\-]+[\\s]*:[\\s]*[a-zA-Z\\-]+[\n\t\\s]*;[\n\t\\s]*}
but it works only if the css rule contains only one attribute like this:
.Red
{
color:Blue;
}
the question is how can I let it match the css rule even if it has multiple attributes.
Dad
|
|
|
|
|
I want to select a member of TabControl by stroking keyboard but not by clicking the mouse on it.So,I think I have to create a shortcut key for that member.Can you tell me how to create it? Thanks
Hello Friends
|
|
|
|
|
with a keyboard event ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
if i understand correctly you want to make a event on e keypress no with a mouse ex. pressing the F* to raise the event that you want.
i think that in the form that you want to do the shortcut you have to enable keyPreview to True and on the keydown event of the form you should write that on what keycode it should raise this event.
ex...
if (e.KeyCode == Keys.F8)
{
write the code...
}
maybe it should help
spaps
|
|
|
|
|
hi,
i get an error when i try to remove the specific row ....which is following
Message = "Rows cannot be programmatically removed unless the DataGridView is data-bound to an IBindingList that supports change notification and allows deletion."
how can i change the data-bound configuration .
|
|
|
|
|
Hi,
I am developing an windows based application in which some print menu is present which prints the project information.
So i am using "PrintPreviewDialog" control in my application. But the problem is when there is no printer installed in my computer then it is not showing the preview.
but in microsoft word and others it is showing the preview so.
How to show print preview when no printer is installed on ur computer or no printer is connected to your computer. At least it should show the print preview. Is there is some method or some property.
I am using printdocument object in it.
Please guide me.
|
|
|
|
|
Is print preview enabled for Wordpad or MS Word on that computer?
I would just install a generic printer driver and it should work. The printer doesn't have to be plugged in to do a print preview.
|
|
|
|
|
Word, Excel is showing the preview.
But my application is not showing preview
|
|
|
|
|
Even i am also facing the same problem.Can anyone please suggest me the solution?
|
|
|
|
|
|
relative to what ?
No.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
|
Sorry for the delayed reply but thank you very much for the useful answer.
Kind Regards,
Mushq
|
|
|
|