|
Hey,
in my excel plugin , i have dynamically generated the OLEOBJECTS Textbox ..
when i click on them to write something . THEY opens up the
Private Sub cmdActionTxt0_Change()
End Sub
VBA editor
i do not want it to be opened and simply want to write over them.
How is that possible
|
|
|
|
|
Hi every
I have two questions
First whats the meaning of "reference" in .net ?
public partial class MyForm : Form
{
...
...
public MyForm getForm()
{
return this;
}
}
and second
When this method is called, a reference, this , is returned to the calling method. could you explain it for me?
thanks
|
|
|
|
|
Neither question has anything specifically to with .NET, they are more to do with the language structure. See here[^] for the definition of reference types; there is also a simpler description in Charles Petzold's excellent .NET Book Zero[^]. The this name is merely an alias for the current object.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
A reference could be though of as a pointer to a memory location.
this is a reference to the object itself.
|
|
|
|
|
Hello,
I am writing an application that perform image acquisition frome a camera.
The image aqcuisition is done by a DLL Supplied by the camera manufactorer.
Basicaly im initializing the DLL and then i start capture,in my application i defened a function that is called by the DLL every captured frame,this "OnFrameCapturedHandler" function gets the frame as the parameter.
Then i perform some calculation on the frame and i display it on the GUI.
But the problem is that the grabbing is faster then my calculation so what happens is that a new frame comes in while the previous is still processed.So what i need is some way to block or to make "OnFrameCapturedHandler" not to do anything while previos frame is Processed.
I tried to put boolean at the begining of "OnFrameCapturedHandler" and set it to false while still processing and at the end set it to true.
And before entering the "OnFrameCapturedHandler" check it.but it freezes my app.
???
Thnaks.
|
|
|
|
|
Sounds like you are doing the processing on the primary (UI) thread. Move the calculation into a background thread, and Invoke the resulting image back to the UI thread.
|
|
|
|
|
Hey,
Sorry i posted the question in a wrong place im writing the app using MFC.
But still the calulation is done on other thread not the UI(main).
I think its done on the same as the DLL that perform the grabbing
|
|
|
|
|
Just because something is in a DLL doesn't mean it's necessarily in a different thread. Unless you specifically spin off a thread - or know that the DLL does this, then the chances are that it's done on the UI thread. The simple fact here is that the UI freezing is an indication that it's being locked by the processing.
|
|
|
|
|
Excellent point Pete... exported functions are usually on the same exact thread as the calling thread. Unless you intentionally thread that off (task it to another thread).
|
|
|
|
|
As Pete has already pointed out, your processing code is being run on the UI thread that "holds up" the application from refreshing the UI. You should move your processing code to a new thread and send the result back to the main thread when it's done. You may also want to consider processing each frame in a new thread and displaying the results in a new window.
|
|
|
|
|
Hi,
I often bring my program in development from home to office.
Each time I have to adjust the directories in the property page of the program.
Is it possible to know in wich file are stored these properties?
Perhaps an application can permit to move code from home to office?
Thanks,
Claude
|
|
|
|
|
If you are using C#, the. csproj file keeps the location of the code files. The .sln file holds references to the actual project files.
|
|
|
|
|
If you copy the full source code via a USB, you should really not need to adjust the directories.
Just keep the same folder structure on both machines.
|
|
|
|
|
Not exactly sure what properties he's referring to... but you're right... if you copy the whole thing, it should work.
|
|
|
|
|
You can move your project in any location you like, just copy the project folder and paste it anywhere on anew computer. this will seems to work. Maybe you are experiencing error on referenced components/assembly make sure if you use an assembly from your development pc, make really sure that it does exist on a new computer.
|
|
|
|
|
I have a problem with configuration files (Windows Forms application).
I'm developing an application, that is supposed to be using plug-ins. Plug-ins are enclosed into a dll, that is put into 'plugins' subdirectory in the application root. Each plug-in can have it's own setting, so to make it comfortable to use I want to have configuration of each plug-in in separate config file (for example when plugin1.dll needs some settings it is stored in the plugin1.dll.config).
I wanted to access configuration through the config section (I don't like the "settings" section and it doesn't work for some of my scenarios).
I have now class Plugins.Plugin1.Settings that derives from ConfigurationSection and a section in the app.config that points to this type. I point this type with fully qualified name (I mean with assembly name: 'Plugins.Plugin1.Settings, Plugins.Plugin1').
Everything seems fine. I copy Plugins.Plugin1.dll and Plugins.Plugin1.dll.config to 'plugins' directory and run the application. When I try to access settings I get exception saying, that there was an error creating configuration section module, because assembly Plugins.Plugin1 or one of it's dependencies could not be loaded.
Stupid thing about this (for me) is that the code, where exception is thrown from inside the Plugins.Plugin1 code.
I suppose the problem is that Plugins.Plugin1.dll isn't located inside 'bin', but inside subdirectory, but I can't throw it to bin, cause it isn't part of the main code, it's just an extension. How can I load data from this configuration file? Searched the web all day and didn't find anything usable... maybe I was asking Google the wrong questions
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
|
42
"... having only that moment finished a vigorous game of Wiff-Waff and eaten a tartiflet." - Henry Minute
"...who gives a tinker's cuss?" - Dalek Dave
"Let's face it, after Monday and Tuesday, even the calendar says WTF!" - gavindon
It's plain that they do not yet know what true fear really is. - JSOP 2011
|
|
|
|
|
|
Perfect answer, have my +5
Rajesh B --> A Simple Programmer <--
|
|
|
|
|
while it may be an excellent test, it sure isn't a question. So what is your problem?
|
|
|
|
|
|
Hi - I've just converted an ASP.Net 2.0 solution to 4.0. In general, it seems to work fine, but there's one point in the code that consistently throws an error on 2 Windows 7 machines, one 32-bit, one 64-bit. The same code works fine on a Windows 2003 machine in the 2.0 framework. Note that both versions are being run through Visual Studio, the 2.0 version in VS2005, the 4.0 version in VS2010. I also get the same error message if I publish the 4.0 version to a Windows 7 machine and run it from IIS or in the browser (IE9). The code that breaks is as follows:
string strSelect = "SELECT * FROM Tasks WHERE UserID = " + UserID + " AND ClsdDate IS NULL AND Task LIKE 'Employee Move - " + RequestItemName + "%'";
SqlConnection dsConn = new SqlConnection(ConfigurationManager.AppSettings["DSN_TRACKIT"].ToString());
SqlDataAdapter dsDataAdapter = new SqlDataAdapter(strSelect, dsConn);
SqlCommandBuilder dsCommandBuilder = new SqlCommandBuilder(dsDataAdapter);
dsDataAdapter.UpdateCommand = dsCommandBuilder.GetUpdateCommand();
dsDataAdapter.Fill(dsTrackit,"MoveTasks");
The error message is:
Network access for Distributed Transaction Manager (MSDTC) has been disabled.
Please enable DTC for network access in the security configuration for MSDTC
using the Component Services Administrative tool
Note that the code does not involve a transaction, or more than one SQL Server and my DBA swears that DTC is enabled on ALL SQL Servers involved in this solution.
So what's going on here? I've googled the error message, but I've seen nothing that could explain this. I don't know if this is a Windows 7 issue or a .Net 4.0 issue.
Thanks!
|
|
|
|
|
Look Here[^]
It is an older post, but one of the solutions there might work.
DISCLAIMER: I have never used any technology in the post, but I Googled the error message, and that came up as the first hit.
|
|
|
|
|
Thanks for the link. I've been trying to post a reply to this thread for two days; there must be something in my reply that's causing IE to explode. So I'm going to try to post an overview of what I've tried without posting explicit code. I appreciate your patience.
To try to solve my problem, I set a string variable to be my SELECT statement, where the SELECT statement does a SELECT COUNT(*) and evoked it with ExecuteScalar.
This errors out with the same error message when I try to open my connection.
I dug farther into the code and realized that this SELECT statement is inside a transaction that's opened two levels up. Within the transaction there are calls to another database server, so I'm guessing that that's where the DTC error is coming from.
Basically, within the transaction (which is set to IsolationLevel ReadCommitted), there are two calls to a SQL Server 2008 R2 server which work fine. Then comes a method that calls a method that calls my SELECT statement to a SQL Server 2003 server.
Note that this code works fine in .Net 2.0, but breaks if I convert the solution to 4.0. It also breaks if I convert the solution to 3.5. Could the problem be the IsolationLevel setting? I can't imagine why that would be the case, but....
I did manage to get around this problem by creating a stored procedure to do the SELECT statement and calling it through a linked server on the 2008 R2 machine.
HOWEVER, when the next ADO.Net call is made to the 2008 R2 machine, I get "Error Message: The operation is not valid for the state of the transaction."
I'm stumped. Any ideas?
|
|
|
|