|
Do you mean how do you pass a picture as a command line argument to a Windows Forms application? You need to be far more specific in your questions.
|
|
|
|
|
I have:
1.. MFC application (application of test)
2.. C# dll ( ActiveX control : COM)
I have implimented method in the Dll that receive Object (which I think it works) with name AddContextMenu(string A_strCaption, Object A_Icon);
So what I need is to Load a picture from Hard Disc and pass it as parameter for this method.
this is some code c++ where I have to call and pass the picture :
MyCtrlActiveX->AddContextMenu(_T("Assign PN"), ?????);
|
|
|
|
|
Passing things like images across COM is not trivial.
I think you have control of both halves of the application, and your question is just about adding icons to context menus? You should pass the information that the C# control needs to construct the image, and create the image in C#, instead of trying to pass it across the bridge. (For example, store the icons as resources in the C# assembly and pass the name of the image to use.)
Your question is still not very specific, but I suspect it is a case of 'I wouldn't have started from here' and you should be able to find a good solution to your problem which doesn't require you to send complex objects across COM.
|
|
|
|
|
Try passing the HBITMAP handle, so you can get the image in .NET with Image.FromHBitmap, or pass the string containing the image path on the hard disk, so you can get the image in .NET with Image.FromFile.
|
|
|
|
|
can you explain more please.
|
|
|
|
|
|
Be more specific. I have no ideea what exactly you want.
Pass a filename to the app args[] so that it(the app) opens the image automatically? Like in double clik from desktop?
Or form another app? or From/To a DB?
All the best,
Dan
|
|
|
|
|
I have:
1.. MFC application (application of test)
2.. C# dll ( ActiveX control : COM)
I have implimented method in the Dll that receive Object (which I think it works) with name AddContextMenu(string A_strCaption, Object A_Icon);
So what I need is to Load a picture from Hard Disc and pass it as parameter for this method.
this is some code c++ where I have to call and pass the picture :
MyCtrlActiveX->AddContextMenu(_T("Assign PN"), ?????);
|
|
|
|
|
What kind of application? Console app? If so, just pass the filename as a command-line parameter and handle it in the code.
|
|
|
|
|
No, it is a windows application MFC and I should pass the Image as paralmter , not just the path.
thank you
|
|
|
|
|
I think you need to use System.Diagnostics.Process.StandardInput[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
more explication please if you can.
|
|
|
|
|
Dear friends,
I have a window scheduler which pionts an exe.
This schduler failes while starting automatically where as if i run maunally, it is executed successfully.
Front End: DotNet 2.0
Back end: Oracle 9i
The error message which i get is
OCIEnvCreate failed with return code -1
I'm cluless.
Thanks & regards
SWARAN
|
|
|
|
|
Swaranjeet Singh wrote: OCIEnvCreate failed with return code -1 I'm cluless.
The first thing to do is to find the documentation for this function and see if you can determine what a status of -1 indicates. If it follows the usual patterns then there should be some more data somewhere that will give you a more specific reason.
I must get a clever new signature for 2011.
|
|
|
|
|
thanks for your response.
The error which i got is
OCIEnvCreate failed with return code -1 but error message text was not available.
This error captured at the time of establishing connection to the database.
|
|
|
|
|
Did you ask Google?
Here[^] is the first hit, I suggest you read it.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Assuming both are running on the same machine, it sounds like a possible permissions issue. Does the account the Scheduler task is using have permissions set in the Oracle client config?
"You get that on the big jobs."
|
|
|
|
|
It's probably a permissions issue as your windows service will be running under its own identity as opposed to your user identity. To resolve this, take a look at these threads 1[^] and 2[^].
|
|
|
|
|
I'm also facing the same issue.I tried the ways you suggested.
I'm not getting this error regularly.its fluctuating.
|
|
|
|
|
How to create master form in .net winform 1.1 same as in asp.net master page
Thanks in advance
|
|
|
|
|
WinForms works in a different way than ASP.NET, there is no masterpage-concept. You can create a new form, and inherit from it. Would look something like this;
public MyMasterForm: Form
{
}
public MyNewForm: MyMasterForm
{
} Good luck
I are Troll
|
|
|
|
|
You can do as Eddy suggested, or otherwise you could create one form with a panel that gets populated with Usercontrols.
|
|
|
|
|
Hola,
So here's the thing..
I'm using Visual Web Developer 2010 Express and SQL Server 2008, and I'm trying to connect to this goddamn database using C#.
I've created an ASP.NET Empty Website, and I've created an SQL Server Database in the project as well.
So here's how my Page_Load function looks (where I try to connect to the database):
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlCon = new SqlConnection("server=localhost;database=Database;Trusted_Connection=yes;connection timeout=8");
try
{
sqlCon.Open();
}
catch (Exception err)
{
errorLbl.Text = err.ToString();
}
}
But it just won't work...
I'm obviously doing something wrong here, but what?
And what's this bullshit about username and password in the connection string? It's just a local database for god's f***ing sake!!!!
Thanks in advance,
Jop
modified on Tuesday, March 22, 2011 6:32 AM
|
|
|
|
|
You missed the vital piece of information out of your rant here - what's the exception? Throw us a bone here.
JoplinsSlave wrote: And what's this bullsh*t about username and password in the connection string?
It's just a local database for god's f***ing sake!!!!
It's a local database that can be evaluated by outside systems, so I'd assume that security might be reasonably important to you.
At a guess, I'd suspect that the issue you are facing relates to the fact that the user identity you think is hitting the database is not the one that is actually hitting the database. When you develop a website and host it in your webserver, by default it runs under a user account with lowered privileges (for security reasons). This means that even though you are connecting from your client code when you log in as you, the actual account that's hitting the database is the account that the web site is running under.
|
|
|
|
|
Thanks a lot for taking your time to answer me, despite the ridicilous tone I had..
It's in swedish so it's most likely rather jibberish to you, but it basically says "The server could not be found or is not available".
I run it on IIS however, which is why username and password confuse me.
Also, should I really use localhost as server when I'm running it local like this?
Thanks,
Jop
|
|
|
|