|
I recall having seen several similar messages on DGV recently.
Seems to me there are some bugs...
Luc Pattyn
|
|
|
|
|
Those were probably me . I've been spending a lot of time in the DGV lately.
|
|
|
|
|
Hi,
I am using the Windows.Forms.Webbrowser component to display some text and graphics in my application, as it makes formatting quite easy, and I need flexibilty here. Everything that goes into it is set directly via the Code, not downloaded elsewhere.
As I need some interaction with this component, I have to use Javascript, which works fine so far, except one point: If the user has it disabled in Internet Explorer settings, it won't work in the component either.
Is there a way to programmatically allow its own application to use scripts? It should be, I guess, and I googelt a lot, found something with SecurityManagers etc, but I mussed have missed the point
So any help or code snippet is welcome
Thank you very much
Oh, and if you happen to know how to reference graphics from the included project's ressources instead of the program directory via the img-tag... would be a nice feature, too...
Tired of searching, frustrated of not finding ...
Thank you so much,
Eiko
|
|
|
|
|
Hi,
I successfully use the string.replace function.
Newstring = oldstring.replace(“*”,”~”)
Now I want to count the number of replacements made.
Thanks in advance!
Kermit
|
|
|
|
|
Hi,
String.Replace() or any other method wont tell you, but you could try a loop
int startPosition=0;
int n;
for (n=0; ;n++) {
startPosition=oldstring.IndexOf(searchString, startPosition)+1;
if (startPosition<=0) break;
}
before performing the Replace.
Luc Pattyn
|
|
|
|
|
Perhaps it can be done using a RegEx replace and a delegate. That would give you the opportunity to do something for each replacement.
A simple way (but not so effective if the string is large) is to create a string where you remove the character, and compare the lengths:
int cnt = oldstring.Length - oldstring.Replace("*", "").Length;
---
Year happy = new Year(2007);
|
|
|
|
|
before doing the replacement you could use RegEx.Matches(InputString,SearchPattern).Count.
BTW: RegEx.Replace is also a good method to do string-replacements.
- walter
|
|
|
|
|
Ok, I have to admit that I am stuck here.
My apps form has an icon set for it but I am tired of the compiled exe file not showing that Icon when I view the file in Windows explorer.
The problem is I can't seem to find anything that is really cut and dry on this. I see some stuff that seems to say you can't do it with the IDE and need to use the command line compiler but I have a hard time believe that...
Any takers out there?
I can't believe I am stuck on something so trivial...
|
|
|
|
|
Open the properties pages for the project and take a look under the Application tab (assuming you're using 2005), there should be an Application Icon property.
If you're using 2003 it's a similar thing in the Properties pages for the project.
|
|
|
|
|
Oh man I can't believe I looked right at that and missed it.
Thanks.
|
|
|
|
|
|
I have a program which run fine on my computer and on some client computer.
However, recently, it started to crash at launch time with a mysterious error as in the title.
After a bit of investigation it is probably a missing native DLL dependency in a Managed C++ library.
Investigating a bit more with depends I think the culprit is the following:
C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb\msvcm80.dll
On my computer I have 2 versions of it:
C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb\msvcm80.dll
C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\msvcm80.dll
But on the target computer I have only one version:
C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\msvcm80.dll
And "depends.exe" tells me that my ManagedC++ library is using the other version:
C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.163_x-ww_681e29fb\msvcm80.dll
Although both version are quite old (06/2006 & 09/2006) (i.e. it's probably not a recent windows update) I think this is the problem.
Now why is the linker is linking to the newer version?
How can I link to the older version?
Any tips?
|
|
|
|
|
Welcome to the world of Win32 side-by-side assemblies.
The version of the assembly that you're going to use is specified in your manifest resources, which are generated from a manifest file. This is generated by Visual Studio and you should find a copy in your 'intermediate files' directory. For some reason, the version number that the manifest specifies is significantly older than the actual RTM version (8.0.50727.42).
When loading through a manifest, on systems which support Win32 side-by-side assemblies (XP, 2003 and later), the publisher can specify that a newer version is to be loaded. They do this by placing a policy file in %SystemRoot%\WinSxS\Policies, under the appropriate folder for the assembly. In the .policy file, they list how the bindings should be redirected. I have an 8.0.50727.163.policy file which says to redirect to 8.0.50727.163.
I also have assembly version 8.0.50727.91 - I'm not sure where this came from, it doesn't have a corresponding policy file. I think version 163 came with .NET 2.0 SP1. Visual Studio 2005 SP1 has yet another new version of the runtimes, but I'm not sure of the version number.
Win32 side-by-side assemblies are pretty complicated and you should ensure that you install the CRT through one of the supported methods: the vcredist_x86.exe file, or the CRT merge module (MSM). If you use the CRT merge module you must also use the corresponding policy merge module, or it will fail to load any version due to the manifest in the application asking for an older version than is on the system. That is, you should merge in both Microsoft_VC80_CRT_x86.msm and policy_8_0_Microsoft_VC80_CRT_x86.msm .
|
|
|
|
|
Thanks for this interesting food for thoughts!
I will look into that monday...
|
|
|
|
|
Dear Friends,
Could you please help me in this regard. What I need is this,
1. I want a .net User Interface to display office files(word, excel etc.).
So that I can put it in my web page to display office files. Similar to
DSO Framer control, but DSO Framer control is an activeX control made by using un-managed code.
But I need a similar UI, made by using .Net Framework. Doesnt itlook good. Could you please help me in this regard.
Thank you.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
You know, it's hard to understand why you ask the same question over and over, especially when the last time you asked it is still visible.
I suggest you either write what you need, or tell your client that it doesn't exist. If it does, it costs money and people are trying to sell it. So, they want to find you, and if you can't find it with google, it probably doesn't exist.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Mr. Christian,
It is truely needed thing for me. May be its not imposiible. In one or the other I may get it. Thats why I am putting my query. And one more thing it would be really flexible and reliable to have such kind of control. Because .Net has features than any previous micro soft products.
Mr. Christian please try your level to help me for "Gods" sake. Because I am not comminting person in the view of user friendliness to clients. In some cases I will be ready to make it my self. Please try to help me please. Thank you.
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: It is truely needed thing for me.
I needed a .NET wrapper for the Canon camera SDK. Instead of asking people to write me one, over and over, I wrote it myself, having established that none existed. That's how life works.
indian143 wrote: And one more thing it would be really flexible and reliable to have such kind of control. Because .Net has features than any previous micro soft products.
First of all, I'm sure it would be. Second, you're wrong. .NET can't do a single thing that can't be done in C++, how could it ? All it does is make it easier to write particular types of apps, compared to C++.
indian143 wrote: Mr. Christian please try your level to help me for "Gods" sake.
I'm not sure what sort of help you're after. Do you think I can write what you want in a matter of seconds ? So that it's 'flexible and reliable' ?
indian143 wrote: In some cases I will be ready to make it my self.
Well, I'd say that's what you need to do. I've already pointed out that for newer versions of Office, a .NET API exists, that seems like a good starting point. I'm still unconvinced that it will result in a component that's any easier to install from a client point of view than a C++ ActiveX control, but I Could be wrong.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
You either have to use DSO Framer or you will have to go with a third party product like ASPOSE.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Yes, I tried with Aspose, it was excellent. I prepared 90% of the requirement. Then they said no we dont want this sort of thing. The only problem with Aspose, which they dont like is it doesnt have UI. Thats the only problem.
About the other things which you replied, I too believe in them. But still we shouldnt be so over confident like "Heitler". Ok, in any way one day or the other I may sit to start it on my own. Still as a human being I am asking you, you are most welcome to send the answer for my query always. And this is request too. Ok. Take care. Bye
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
a little stumped with a regex i've been working on...
trying to parse name/value pairs from a string - I have something close, but it chokes on certain cases.
(?# PROPERTY )(?<property>[a-zA-Z0-9_]*)\x20*?(?# OPERATOR )(?<operator>>=|<=|<|>|=|!=|LIKE)(?# Value )\x20*?'?\w+'?
// any property name of any length, captured into backreference 'Property'
(?<property>[a-zA-Z0-9_]*)
// whitespace, 0+, minimal matching
\x20*?
//any of the operators >=, <=, <, >, =, !=, LIKE captured into backreference 'Operator'
(?<operator>>=|<=|<|>|=|!=|LIKE)
// whitespace, 0+, minimal matching
\x20*?
// single quote, 0-1
// followed by word character, 1+
// followed by single quote, 0-1
'?\w+'?
I am looking to match (and extract) name/operator/value pairs from a string, such as...
PropertyName='SomeValue' AND IntProperty < 9 OR AnotherProperty LIKE 'this is a test'
the regex i have above works fine for the first two terms, but then when you get a quoted string, it only matches up to the first space... This is only ever going to be an issue with the quoted strings, anything else will assume a word boundary on whitespace, which is the desired behavour.
I need that last part of the Regex to basically say "if we're enclosed in single quotes, get anything between the opening and closing quote; otherwise, match everything up to whitespace"
any help is much appreciated. (or if anything spots any weak spots in the Regex i have so far..)
thanks -
|
|
|
|
|
You will need to test for quotes and assign the substring a name. Do this at the first place in your expression where the quotes can occur. This will test for optional single or double quotes:
(?<ql>[""']?) -- *The double-quote is repeated as shown if it exists in a VB string.
You must then use conditional matching to test whether <ql> has been assigned. The syntax for the conditional match is:
(?<name or expression>yes|no) -- The |no portion is optional.
So,
(?<ql>\k<ql>)
Will test whether <ql> was previously assigned, and if so it will match it again. Otherwise, it does nothing.
Hope that helps.
|
|
|
|
|
Keith -
I was headed in that direction, but couldn't quite get it.. Thanks for the help on it.
What you have helped with has given me..
(?<Property>[a-zA-Z0-9_]*)
\x20*?
(?<Operator>>=|<=|<|>|=|!=|LIKE)
\x20*?
(?<quote>[""']?)\w+?\k<quote>
\x20*?
which matches the following
PropertyName = 'Blah' AND PropertyTwo >= 9 OR PropertyThree = "asdf" OR AnotherProperty >= 'thisis atest'
perfectly up until the last part...
AnotherProperty='thisis atest'
the \w+? will stop at the space in between 'is' and 'atest', which is where i am stuck now. using .*, or something similar captures too much... I am inclined to believe that using a negated character class [^""'] is the way to go, but am not positive how to do that; the things I have been trying wind up matching too much. Any ideas?
Thanks -
-- modified at 9:21 Friday 5th January, 2007
|
|
|
|
|
Try replacing the \w+?\k<quote> with:
.+\k<quote>
This will match everything between the quotes.
The \w is matching any word character, so it's not matching the spaces. The period will match anything, and since we want to get everything between the quotes, we use the + to denote one or more matches.
Hope that helps.
|
|
|
|
|
You really have a grammar there, not just a regular expression. I'd recommend using something like ANTLR[^] to parse your expressions. It's a lot less of a headache than trying to do a single RE that does the whole job.
|
|
|
|
|