|
thanks a lot for your help!
Paolo
|
|
|
|
|
Hi every one:
I want to get a picture from access.I try to do it in many way.
But I failed.Could you give me some addvices?
Best wishes
|
|
|
|
|
|
Thank you:
But it is a sql database.
I want to do it in Access database.
could you help me?
|
|
|
|
|
Don't remember how things are done in Access, but normally images are stored to BLOBs (SQL datatype). Try to look from Access documentation is there any help available from BLOB datatypes. I am also pretty sure that there is ready example somewhere for access also. Try to use some google
|
|
|
|
|
I've got an application that I'm writing that I want to use plugins with. I've looked through the plugin examples, and to the best of my knowledge have done the same (although in a slightly different fashion) as the examples.
Oh, and sorry about the lack of tabs...I can't seem to get the forum to display them...
My plugin interface:
// The terrain modifier plugin interface.
public interface ITerrainPlugin {
string Name{get;}
void ShowInterface();
void CalculateHeight(float[,] heights);
}
The test plugin (no actual meaningful code...):
// project created on 4/1/2004 at 12:58 PM
using System;
public class TerrainNoisePlugin : ITerrainPlugin {
public string Name {
get {
return "Deffie's Terrain Noise Plugin";
}
}
public void ShowInterface() {
System.Windows.Forms.MessageBox.Show("Interface? Ha! Not yet, bud ");
}
public void CalculateHeight(float[,] heights) {
}
}
And here's the code to load the plugins (each is located in App.StartupPath + "\\Plugins\\Terrain\\" and args contains the class name, which is the same as the dll file name minus the .dll):
try {
Type plugType = null;
Assembly asm = null;
asm = Assembly.LoadFrom(Application.StartupPath + "\\Plugins\\Terrain\\" + args + ".dll");
if (asm != null) {
plugType = asm.GetType(args);
} else {
MessageBox.Show("Assembly is null");
}
if (plugType != null) {
object instance = Activator.CreateInstance(plugType);
if (instance != null) {
MessageBox.Show("Instance isn't null...type is: " + instance.GetType());
} else {
MessageBox.Show("instance is null");
}
ITerrainPlugin plugin = (ITerrainPlugin)instance;
if (plugin == null) {
MessageBox.Show("plugin instance is null");
} else {
plugin.ShowInterface();
}
} else
MessageBox.Show("Type is null");
} catch (Exception eX) {
MessageBox.Show("Error: " + eX.Message, "Error");
}
It complains at this line:
ITerrainPlugin plugin = (ITerrainPlugin)instance;
With the complaint that this is not a valid cast.
Any ideas?
Aaron
|
|
|
|
|
Defiant00 wrote:
MessageBox.Show("instance is null");
TerrainPluginInterface plugin = (TerrainPluginInterface)instance;
Need i say more? [edit] actually I think I read it wrong (why dont ppl use {}?), what does the previous message box say? [edit]
top secret
|
|
|
|
|
Sorry about the lack of {}'s, since it was just some extra code I stuck in there to try and figure out what was going on (and the fact that it's rather easy to read if the tabs would show up properly...)
Anyways, I went back through and added {}s...by the way, the instance is not null when I run this (which is what has me so puzzled).
Aaron
|
|
|
|
|
Could it be that you need to define "TerrainPluginInterface" in own dll. And share this DLL with "TerrainNoisePlugin" and your application code? (Or define "TerrainPluginInterface" in same dll with your application and use application's "TerrainPluginInterface" in your plugin code.) Where is "TerrainPluginInterface" coming to your application code?
(BTW: Normal naming convention for interfaces is "I<interface name="">". For example: "ITerrainPlugin". ... and yes people really should use those bracers. Code is not writen for computers, it is written for humans (except binary machine code).)
|
|
|
|
|
Ah...I guess that's what I was missing there (at least I hope that's what it is). I'm looking back over the tutorials...yeah, guess I skipped a bit too much of the explanation in favor for the code.
Also, didn't know about the naming convention, thanks for that (I've changed it now). As far as using the braces...well, if the forums would show tabs (although I imagine there's a way that I just don't know of) then it would be nice and readable anyways...but oh well...
Anyways, thanks for the suggestions, I'll look into it and hopefully have it working shortly.
Aaron
**And as an update (if anyone cares :P ) that fixed it.**
|
|
|
|
|
hi what tutorial did you use for your application as i'm also
trying to have plugin support on my application.
thanks dennis
|
|
|
|
|
Hi everyone,
I'm trying to figure out how to determine the DoubleClick interval that's set in MouseSettings. Does anyone know where this is kept? Is there a .NET API for it, or should I grap it from the registry?
Thanks for your help,
Tom Clement
Apptero, Inc.
|
|
|
|
|
Hi again,
A search of the Registry answered my question for me. It is stored in HKCU\Control Panel\Mouse in the value named DoubleClickSpeed. It appears to be in Milliseconds.
Tom Clement
Apptero, Inc.
|
|
|
|
|
Is it a sign of insanity to talk to yourself?
SystemInformation.DoubleClickTime
Tom Clement
Apptero, Inc.
|
|
|
|
|
Tom Clement wrote:
Is it a sign of insanity to talk to yourself?
Nope, just when you argue with yourself.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Sometimes is best to try put a problem on 'paper'. That way you know the problem is correctly formulated, and when you get good at programming a different look at things is sometimes all that is needed to grasp the solution.
top secret
|
|
|
|
|
leppie wrote:
when you get good at programming
Geez, I hope that some day (soon, before I die) I'll get good at programming....
Tom
|
|
|
|
|
I got a text file that i exported from SQL Wizard and i named bank.txt.
i want to write out a program that allow to import bank.txt file to SQL Server but i do not know how to do it.
So can anyone help me or show me where to get the source code.
Thank a lots.
quoc
|
|
|
|
|
Hi,
Try reading your textfile using the "streamreader" and save it one at a time using the INSERT statement into your SQL server.
IF your text file is big or you often do it, might as well use the DTS in #C. I haven't tried it but I know it will work.
/dabuskol
|
|
|
|
|
I have a program that works perfectly fine but i want to change one thing.
my database data.mdb is on the root of my c drive.
I want to put it in my project directory. I would assume i could move the database anywhere i want and just reconfigure the oleadapters accordingly. Well for some reason its not working as i thought it should.
Here is what i do.
I right click on the Adapter1 and hit configuration.
I hit new connection and select the connection for access.
i then select my database and test the connection. It works fine.
so i know have ACCESS..\data.mdb.Admin
I then hit Query builder and select my columns Help and Information.
I then hit finish.
I then go back to the configuration adapter and want to add
WHERE (Help = ?)
so query looks like this
SELECT Help, Information FROM Csharp WHERE (Help = ?)
i hit next and get the following error.
OleDbCommand.Prepare method requires all variable length parameters to have an explicitly set non-zero Size.
I don't understand the problem cause if i reload my program from my backup files. putting it back to the state of where the database was in the c:
it works perfectly.
Any Idea would be great
Win32newb
"Making windows programs worse than they already are"
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
I have seen this before, it appears VS.NET keeps the references in the DataAdapters, my remedy was to recreate them all. Easy when u have stored procedures, bad with select statements
top secret
|
|
|
|
|
I couldn't figure it out. Maybe Heath or one of the other MVPS can explain this. Here is what I ended up doing to fix it which basically relates to what you stated.
I said heck with the adapter query.
I left it as the default of
SELECT Help, Information, ID FROM Csharp
i then in my code instead of using my old parm method i do this instead.
string strSQL = "SELECT * FROM Csharp WHERE Help = '" +
comboBox1.Text.ToString() + "'";
oleDbSelectCommand1.CommandText = strSQL;
dataset.Csharp.Clear();
oleDbDataAdapter1.Fill( dataset );
works perfectly
thanks for your reply by the way
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
I'm trying to display 2 text boxes side by side and have them scroll together, for something similar to a file comparison utility.
I have them controled with a scrollbar by sending WM_VSCROLL messages to them with P/Invoke. I'm having trouble capturing the EN_VSCROLL messages from the textboxes. I've tried Application.AddMessageFilter and overriding Form.DefWindowProc, neither of these seem to get the message. I can see the message in Spy++, but I can't seem to capture it with any CLR method.
What is the best way to get these messages using C#?
|
|
|
|
|
Extend the TextBox class and override WndProc . For a good design, add a property to this class that takes a reference to another TextBox that it should send messages to.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
That didn't work either. I'm still only getting Keydown messages, but no WM_COMMAND/EN_VSCROLL messages. I wasn't sure that would work either since the text box is sending the message to the parent window.
|
|
|
|