|
Then how do you expect to "persist" the data? It normally means to make it persistant between executions of your application.
Now, you're talking about interprocess communication...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
A class with public static methods - then you don't need an instance, and you can call it from anywhere. I've done logging like this. I actually said this in my first reply.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
As I said in earlier thread ...
My application consists of many different assemblies. Logging is in one assemblie and mainapp is in another.
Can you give me information about how you did it ...
If I stand in my logging function Intellisense only shows that assembli. I can in no way see the other part of the namespace.
//Maw
|
|
|
|
|
My advice is the same - have a logging class which is given the information to log, making a class able to see everything across all your assemblies is just a bad idea. If you want your logging to always store the same info, add methods on the classes so you can get it, as a string so that it's human readable, but not machine readable.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can you give me an example of your suggestion in code?
//Maw
|
|
|
|
|
I don't do VB, but here's some C#.
class Logging
{
public static void Log(string message)
{
// Access the log file via a lazy initialised property
// Write the message to the log file
}
}
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well .... thats how I d it today .... Only part I'm missing is how I'll get the properties over there like username and "function" and so on. Maybe the best way is a settingsclass wich reads from an XML-file. Maybe Serialization is good idea here.
//Maw
|
|
|
|
|
MaWeRic wrote:
Only part I'm missing is how I'll get the properties over there like username and "function" and so on.
You need to pass them through. How else would you do it, generically ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thats exactly what i DONT want to do ....
Just want to call that function and it does all I want just from calling it. It is a shared function and I don't set an instance.
To make it very simple : I have a mainform with a class/structure wich just contains some properties like username, userID etc. Can I in any way read those properties from another assembly? Both mainapp and log-assembly resides under same root´-namepace i.e "MySys.MainApp" and "MySys.sys.Logging"
I heard something about application-reflection and application domains. Is this something that I can looka at?
Maybe I'll just settle for a settingsclass wich reads properties from a XML-file with serializesation or something like that. Not nice though. But maybe the only way?
And thanks for all your help and suggestions ... You have opened my eyes ...
//Maw
|
|
|
|
|
Calling ShowCursor(FALSE) in either VB.NET or classic C++ 6.0 doesn't seem to hide the mouse at all. The return value indicates success (the show count decrements) but nothing happens to the cursor.
Any ideas? I'm trying to write a full-screen magnifier, which has its own fake mouse cursor. Therefore I need to hide the real one.
Thanks!
|
|
|
|
|
How about System.Windows.Forms.Cursor.Hide ?
|
|
|
|
|
No no, I think you misunderstand. I want to hide the cursor across the entire system, not just in my own window.
Cursor.Hide works, but only for my own windows. I need to hide the real cursor across the entire screen, and display my own fake one. I've already done the second part.
I'm making an accessibility app for partially-sighted users.
|
|
|
|
|
Oops!
Well, not sure about that one.
I tried ShowCursor, but it works just like Cursor.Hide (Hides only in same app)...
|
|
|
|
|
That's right, that's how it works!
The mouse cursor is controlled by each individual application, but only when the cursor is in that applications window bounds.
You can't get ride of the cursor system-wide, but you can set it to a blank image. You'll have to create a blank cursor image, then call the Win32 API function SetSystemCursor[^] to make the cursor "disappear".
Another option would be to confine the cursor to a bottom corner of the screen. You'll have to call ClipCursor[^] for that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I can't use ClipCursor, because I need the user to be able to click on stuff. It's just the image I need to hide, so I can replace it with another in a different place.
I'll try SetSystemCursor, thanks. Any idea if it's possible to grab the current cursor image and draw it as a graphic on a window?
Thanks!
|
|
|
|
|
Here i am again!
How about LoadCursor[^]
To use one of the predefined cursors, the application must set the hInstance parameter to NULL and the lpCursorName parameter to one the following values: IDC_ARROW etc...
BTW: stupid of microsoft to don't make a GetSystemCursor
|
|
|
|
|
Nah, that won't help. I need to get /all/ cursors - e.g. the left-handed line-selection cursor M$ Word uses when you point at the left margin. I need to grab its image and /also/ prevent it ever being displayed. I'm trying to intercept all cursor changes and use them for my own purposes.
Thanks for trying, though
|
|
|
|
|
Hey Guys,
I am New to this forum!! I need help on VB .NET
# I have got some Sub Procedures that constantly repeat in some forms.
Can i put these in a module??
# How do i call the Module??
# Also, do i need to declare things like variables,dataadapters,dataview,dataset
etc. used in those Sub Procedures in the Module??
(l0phtcrack)
|
|
|
|
|
It's really easy. Right click on you project and click add new item. Select module. Then code your procedures (if your smart you will use functions) as public and you can call them from your app. You pass paramters just as if they were in your code page.
"People who never make mistakes, never do anything."
My blog
http://toddsnotsoamazinglife.blogspot.com/
|
|
|
|
|
I dont want to return any values from my procedures, thats why i wanted to use Sub Procedures.
Neways, how do i call the Module.Is it like this...
Class form1
Sub form1_load(....) handles.....
Module()
End Sub
End Class
Also, where can i declare such things that i need in every module,class,form, etc..
(l0phtcrack)
|
|
|
|
|
What would the syntax be on the following with the Array.Copy method
Array1 values
1, "Sue"
2, "Peter"
Array2 values
3, "Mary"
4, "Alan"
I want Array1 to be like
1, "Sue"
2, "Peter"
3, "Mary"
4, "Alan"
I have tried Array.Copy(Array1, Array2) but had no joy.
|
|
|
|
|
It seems that all the copy variants want to copy objects over existing ones, I can't see an insert method. You need to do foreach on one array, and insert each value into the other array.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Vb.net 2003
DataGrid
Enter is not working
in datagrid.I press Enter
key in datagrid nothing
to happen. How use AddHandler
in datagrid
I neednot processcmdkey
that make more problem
that call keyup function automatic
Continue...
|
|
|
|
|
Hi everyone!
I have a question. I have a vbScript (.vbs) file that sends emails using outlook. I now want to have that file as include file in other vbScript files like ASP allows you to do:
But I can not find the way to do it.
Is it possible to have a include in .vbs script file?
Does not make sense to have the same code in 2 files if you can make it an include, does it? But I can't find a way... if any of you know how please let me know.
Thank you in advance!
iluha
|
|
|
|
|
iluha wrote:
This is ASP, not jscript, html, or anything else. It won't work in ASP.NET. Instead, put your script into a control, and use the control, or if it's all script code ( no HTML ), make it a constant string and use RegisterClientScriptBlock to insert it into the page, in your codebehind.
Christian Graus - Microsoft MVP - C++
|
|
|
|