|
but can you please explain a bit how can i use my properties to store the user rights? now if I have sql reader to read all the rights wheer user_id = 7 for example... I should read two columns, user_right_code and user_right_value?!! sorry but even after 10 cups of coffee I am still confused....!!
|
|
|
|
|
I have a question.. is thete any way to have a variable called user_rights with a property for every right and its value? if that's possible then I can read the rights from the user_rights table and retrieve the following:
user_rights[ALLOW_CREATE_CLIENT, True)
user_rights[ALLOW_DELETE_CLIENT, False)
where ALLOW_CREATE_CLIENT and ALLOW_DELETE_CLIENT are properties of user_rights
where True and False are values for every property.
|
|
|
|
|
how can i know when a function is been added/removed from my Event?
I want to do some connection when a COM is add a function to my event.
public delegate void DoItDelegate(int i);
....
....
{
DoItDelegate MyFunction;
MyFunction += new DoItDelegate(DoItFunction);
}
public void DoItFunction(int i)
{
}
When the command : "MyFunction += new DoItDelegate(DoItFunction); " is been execute i want to do something in another function.
What can i do if i want to know when this "MyFunction += new DoItDelegate(DoItFunction);" is execute and register it to Datatable?
(The command "MyFunction += new DoItDelegate(DoItFunction);" is in the COM code and not in my code so i can't control it.)
|
|
|
|
|
You mention 'my event' but I don't see any events in your code, only a delegate.
If you are using events then you can use the add and remove methods and call your other function there.
public class DoItUser
{
public DoItUser()
{
MyClass myClass = new MyClass();
myClass.MyEvent += new DoItDelegate(DoItFunction);
}
private void DoItFunction(int i)
{
}
}
public delegate void DoItDelegate(int i);
public class MyClass
{
private DoItDelegate myEvent;
public event DoItDelegate MyEvent
{
add
{
myEvent += value;
DoSomethingElse();
}
remove { myEvent -= value; }
}
private void DoSomethingElse()
{
}
}
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
public delegate void DoItDelegate(int i);........{DoItDelegate MyFunction;MyFunction += new DoItDelegate(DoItFunction); }public void DoItFunction(int i){ //Do Domthing}
|
|
|
|
|
I have made a project for plotting the binary data from network.
The project name is Multibeam echo sounder.
The beam and position format to plot.
The beam consist of 30 lakh of lat,long,depth data.
The position consist of 750 lat,long,depth.
In this the beam i plot is stored in arraylist.
Arraylist store lat long depth.
It get very bulky as it start.
can any body give suggestion over real time plotting.
any type of buffer i used in this?
please rply asasp.
|
|
|
|
|
you have more data points than there are pixels on a typical monitor, that does not make much sense.
can't you somehow reduce the size of your data set, resulting in a more informative output?
also: lists, arraylists, etc. all grow by doubling their internal array and copying their content; swee here[^]. So if you have a good estimate for their final size, allocate that using initial capacity parameter.
|
|
|
|
|
Hi,
Im using C# in VC++ for WPF.
I create one Delegates in C# as follow
public delegate void NameTab(string msg);
public static event NameTab CallClick;
private void Callbutton_Click(object sender, RoutedEventArgs e)
{
String msg = comboBox1.Text;
CallClick(msg);
}
Im using in my VC++ code as follow
Tabcontrol::SecondTab::CallClick += gcnew Tabcontrol::SecondTab::NameTab(OnCallClick);
And OnCallClick fucntion is
static void OnCallClick(CString msg)
{
}
But it shows error
error C3352: 'OnCallClick' : the specified function does not match the delegate type 'void (System::String ^)'
Im using button click event handler and its woking perfectly.But this only shows error.As i want to get the text in combox,im passing that text as parametes and im uisng that text in vc++ code.
pls help me.
Anu
|
|
|
|
|
that is because your callback needs to accept a System.String datatype instead of CString. If you need to marshal String^ to Cstring just do the following.
static void OnCallClick(String ^msg)
{
CString nativeString = msg;
}
And guess what! You may have noticed that you don't have to marshal System.String into a CString in your code. That is because of a little trick in cstringt.h
#if defined(__cplusplus_cli)
template <class SystemString>
CStringT( SystemString^ pString ) :
CThisSimpleString( StringTraits::GetDefaultManager() )
{
cli::pin_ptr<const System::Char> pChar = PtrToStringChars( pString );
const wchar_t *psz = pChar;
*this = psz;
}
this function handles the marshaling for you
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi,
Is it possible to register an assembly using RegAsm.exe into other than HKEY_CLASSES_ROOT hive? or how can I install/uninstall an .Net automation add-in in non-admin mode?
|
|
|
|
|
You can try the following:
Execute "C:\WINNT\system32\...\RegAsm myLib.dll /tlb:myLib.tlb /codebase"
The RegAsm executable is included as part of the .NET Framework.
*Do not register using REGSVR32.EXE
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Thanks. But if you use RegAsm.exe it will register in HKEY_CLASSES_ROOT which require Administrator privileges to do so.
|
|
|
|
|
(1).NET Installation
.NET users can install the Example.dll in several ways including:
a) Add the .dll to the application folder of the application that references it.
b) Install the .dll to the Global Assembly Cache (GAC) located in the
Assembly folder (usually \WINNT\Assembly).
More information regarding the GAC can be found at:
This Link.
(2) COM Installation : Look at my previous post.
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
i am having a string ,say"14p"....I want to take only the value 14 so that i could convert that to integer..how can i achieve this?
|
|
|
|
|
n i want to split that string on occurence of any alphabets
|
|
|
|
|
hi, I did this using regular expressions. I wrote a method to split a string by alphabetic characters.
14p gives array of one item 14
14eur gives an array of one item 14
14eur14pp15p gives an array of 3 items 14, 14, and 15
http://pastebin.com/f55499ed[^]
modified on Wednesday, December 30, 2009 2:56 AM
|
|
|
|
|
how about this -
public String[] Split(String alpha)
{
String str = alpha;
List<String> returnVal = new List<String>();
Regex regexp = new Regex("[0-9]+");
MatchCollection matchColection = regexp.Matches(str);
for (int i = 0; i < matchColection.Count; i++)
{
returnVal.Add(matchColection[i].Value);
}
return returnVal.ToArray();
}
Modified Split function[^]
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Assume that your input string like:
Input: a1f2g3r46mj5kde6
Output:123456
I think at first you split it in to an array and pass each array item to a function for numeric validation. That.s It...
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
I got InvalidComObjectException on exit on release build application. If I don't use RichTextBox, I don't see crash. In debug build application, I also don't see crash. On some release machine, even if I call CurrentDispather.InvokeShutdown won't eliminate crash.
My main appliation is a unmanaged MFC. The WPF control is embedded in CView in this MFC application.
Any idea or suggestion? Thanks.
|
|
|
|
|
I am currently using ControlPain.DrawBorder. it has 2 overloades.
DrawBorder(Graphics, Rectangle, Color, Int32, ButtonBorderStyle,
Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle,
Color, Int32, ButtonBorderStyle)
DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)
With first overload, each size can be set a line width. However the second overload it doesn't. Is this a always constant? if not how can I programaticly acquire this info?
|
|
|
|
|
|
Thanks, that is just what i needed
|
|
|
|
|
I am hosting WPF components in unmanaged MFC. This WPF components will do some ricktext editing. Hosting / editing are working fine but closing will crash application on exit (release version only and no crash on debug). The following is the current structure:
class parentA_COM : definited / implemented in unmanaged C++, STA
class memberB_COM : definited in unmanaged C++, but implemented in C# (ComVisible)
class winUserControl: implemented in C# to host WPF user control;
class wpfUserControl: implemented in C#
class MyApp // unmanaged C++
{
main ()
{
parentA_COM pPA(); // Initialize COM component
}
}
class parentA_COM // unmanaged C++
{
void get_hWnd()
{
m_ipMB.CreateInstance(xxx);
m_ipMB->get_hWnd();
}
private:
memberB_COM m_ipMB;
}
class memberB_COM : IDisposable, ... // C#
{
constuctor // initialize winUserControl
}
class winUserControl : UserControl
{
host WPF control wpfUserControl
}
How can I mark / make wpfUserControl / or winUserControl / or memberB_COM STA? Thanks.
|
|
|
|
|
Hi,
i'm "new" here and try to learn a little c#.NET
So for train a little i thought to write a software, copy a string into the search field of this page: http://www.dict.cc/[^]
After that the software should press the search button and list the items. would be enougth if someone of you can tell me how it works... i already started:
WebBrowser wb = new WebBrowser();
wb.Url = new Uri("http://dict.cc/");
HtmlDocument htmldoc = wb.Document;
// <input name="s" id="sinp" maxlength="100" size="25" style="padding: 2px; width: 340px;" value="" type="text">
htmldoc.All["sinp"].InnerText += richTextBox1.Text;
// <input id="submit" value="Suche" class="inp1" style="padding: 1px;" type="submit">
htmldoc.All["submit"].InvokeMember("Click");
this does not work, i always get the following error for the last 2 lines: "NullReferenceException was unhandled"
and i don't know how to go on... so wait for the response and read the first answer..
|
|
|
|
|
WRONG FORUM
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|