|
Nope, Tell you the truth, It's been a while since I have used OLEDB under the JET engines. I have been using the MSDE version of SQL Server for development.
What is the runtime error?
Regards
|
|
|
|
|
Neil Van Note wrote:
What is the runtime error?
When the messagebox appear,in the place of error message there is no message and its empyt.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
When I run this,
using System;
namespace trim
{
public class trim
{
static void Main()
{
string str = "Senkwe ";
Console.WriteLine(str.Length);
str.Trim();
Console.WriteLine(str.Length);
}
}
}
I get an output of 10 each time. Am I using trim improperly? I even tried specifying an array of characters to be reomoved ie char[] myChars = {' '}; and it still didn't work.
Any ideas?
Regards
Senkwe
Just another wannabe code junky
|
|
|
|
|
Trim returns the new string!
str=str.Trim();
should be the solution
i got into this trap with the Registry-class: when you want to open a subkey you would write
key.open(location); but instead the handle to the opened key is returned. so
key=key.open(location); worked.
in general: someone has to explain to me, what the idea behind this weired design is? this behaviour of returning the result looks to me like a static function (like Color.FromArgb()) - which Trim and this registry-open-function are not.
i don't like that design - and obviously i'm not the only one, that was caught in that trap...
:wq
|
|
|
|
|
Thanks alot! Boy, that was so un-obvious to me. To make matters worse, the documentation had no real examples of how to use it. I agree that it is wierd and inconsistent.
Thanks again
Regards
Senkwe
Just another wannabe code junky
|
|
|
|
|
My guess as to why it works this way is that strings are immutable (can't be changed). So methods that apprear to change the string actually return a modified copy. The original string stays intact which is why you needed to assign the returned modified string to the orginal string variable (i.e. str = str.Trim();
|
|
|
|
|
Exactly
James
Simplicity Rules!
|
|
|
|
|
You really understand this stuff well !
Congrats
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
Free Colin Davies
"real Americans don't criticize their leaders - because they don't want the terrorists to win." -- Quote from Chris Losinger a real American"
|
|
|
|
|
Colin Davies wrote:
You really understand this stuff well !
Congrats
Thanks
I try to be really good at what I do, currently that is C# and .NET
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
I try to be really good at what I do, currently that is C# and .NET
Thats a good attitude to have !
I hope you succeede ?
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
Free Colin Davies
"real Americans don't criticize their leaders - because they don't want the terrorists to win." -- Quote from Chris Losinger a real American"
|
|
|
|
|
I wanna use this dll in my project.How can I import dll in C#?
Thanks
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
[DllImport("kernel32.dll")]<br />
public/private static extern <function prototype here>
James
Simplicity Rules!
|
|
|
|
|
Forgot to mention that you'll also have to reference the System.Runtime.InteropServices namespace to use the DllImport attribute
James
Simplicity Rules!
|
|
|
|
|
hey mazi,
when i look through this forum, i think it would be a good idea for you to buy the petzold-book. it is nice to read and full of information.
just an idea
:wq
|
|
|
|
|
Hi Rupel
I really appreciate your help, but i 've got a little problem here
I live in IRAN, and there is no possibility for us to shop foreign books online
(or even offline ). but thanks anyways.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
oops. sorry.
James T. seems to have CP run on his cellphone/pda anyway - so he is a good backup
but i really admire you're way to look at it: with a smile
:wq
|
|
|
|
|
Rüpel wrote:
James T. seems to have CP run on his cellphone/pda anyway
LOL!
I'm just without a job at the moment so I spend a lot of time coding (with CP in the background) or reading CP.
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
I'm just without a job at the moment so I spend a lot of time coding (with CP in the background) or reading CP.
Funny, because I *have* a job, I spend a lot of time coding with CP in the background..... ( Well, actually I do the same at home, so that's not quite true )
I'm trying to figure out how to improve my screensaver and I wonder if I can link to the dll that handles screensaver behaviour, and hijack the message loop to handle the messages I am supposed to. Does that sound viable to you ? The instructions in MSDN tell me to do this:
Creating a module-definition file
The ScreenSaverProc and ScreenSaverConfigureDialog functions must be exported in the application's module-definition file; RegisterDialogClasses should not be exported, however. The following example shows the module-definition file for the sample application.
Can I *do* this in C# ? My main reason for wanting to is simply that as it stands I do not have multi monitor support and I can't see a way to find my other monitor/draw on it.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
Christian Graus wrote:
Can I *do* this in C# ?
I don't think so, I'm pretty sure you'll have to use Managed C++ for this. I'm not sure if you can export a __gc method, but you can export a regular method which calls the __gc one.
This is the real power of MC++, you can make calls to both sides easily
James
Simplicity Rules!
|
|
|
|
|
I can create a 256 color icon (w/o hotspot) and use it as a color cursor.
I can create a 16 color cursor (w/hotspot) and use it as a color cursor.
But 256 color cursors are coming in black. Any thoughts?
Thanks.
|
|
|
|
|
Finally got it to work. Had to use an outside editor (Michaelangelo)
|
|
|
|
|
This should be absolutely simple, but I'm on a diet and I'm cranky...
I just did 'Add - Add New Item - Cursor File' to my project.
The cursor comes up fine, and I can edit it, BUT the stupid 'Set Hot Spot Tool' never lights up and I can't set it.
When I look at the properties of my cursor, it says 'Icon File'.
The name of the file is 'cursor1.cur'
What is going on?!
Thanks.
|
|
|
|
|
Looks like a bug to me.
James
Simplicity Rules!
|
|
|
|
|
|
Yep, it truly thinks that its editing an icon file.
James
Simplicity Rules!
|
|
|
|