|
but if CompanyA is software house, CompanyB is the client and will not see that namespace, is it a good practice to keep CompanyB in the namespace to indicate the customized project is for CompanyB?
|
|
|
|
|
Hi, i have a small problem i have a csharp dll built in VS2005.I have to access the functions from this dll in my VC++ project done in VC 6.0.My VC project is not able to identify my C# namespace and class.I dont get what the problem is. Please do have a look at my c# code and VC Project code and do let me know if im making some mistake.I have also pasted the errors that i am getting. please do help me...i'm not able to understand the problem.
C# code:
using System;
using System.Collections.Generic;
using System.Text;
namespace TestDllCsharp
{
public class Class1
{
public void PrintMessage ()
{
System.Windows.Forms.MessageBox.Show("Test");
}
}
}
VC Project :
#import "TestDllCsharp.tlb"
using namespace TestDllCsharp;
#include <stdio.h>
void main()
{
HRESULT hresult;
CLSID clsid;
CoInitialize(NULL);
hresult=CLSIDFromProgID(OLESTR("TestDllCsharp.Class1"),&clsid);
if (hresult == 0)
{
_Class1 *t;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_Class1),(LPVOID *) &t);
t->PrintMessage ();
CoUninitialize();
}
}
I get errors like :
error C2065: '_Class1' : undeclared identifier
error C2065: 't' : undeclared identifier
Thnx in advance.
|
|
|
|
|
I assume the tlb means you've created a COM dll. Have you tried specifying the GUID directly, instead of using the smart pointer stuff ? Also, why are you sure the class name gets a _ put in front of it in VC ?
You'd do better to upgrade to a less crap version of C++, and then you can just use managed C++ as your bridge.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
My project requirement is that i have to use VC 6.0
Is there a way to solve this problem?I just dont undertsand why the code isn't able to identify my classes.Is there a problem with my tlb file generation.Please do tell me if there is a solution to this ?
Thnk you ...
|
|
|
|
|
I need to build win app project with reference to a library i created. The structure of the output folder i need is something like this.
bin\Debug
>>|
>>|--app.exe
>>|
>>|-- Lib(folder stored library)
>>>>|
>>>>|-- myLib.dll
Rudimentary, after we build a win app project(an exe file), an exe file can run along with a referenced dll located at the same place as an exe file.
But i need to store dll file in Lib folder like the picture above.
Could you elarborate how to do something like this in C#.NET 2008?
thank in advance
AonzZung
modified on Wednesday, February 4, 2009 1:23 AM
|
|
|
|
|
There's a few ways of doing this.
The nasty way would be to create a new AppDomain in your application and point its base path to your subfolder. You'd end up with marshalling nightmares doing that though.
The simple bodge would be to copy the files from the lib folder into your app's base folder.
Another way would be to dynamically load the dll with Assembly.Load. You can then instantiate the types it contains with the Activator class. Where this runs into difficulties is where your lib assembly references other assemblies. That resolution would not be done for you and you'd have to do it manually. If it only references assemblies in your app's base folder this isn't a problem.
Regards,
Rob Philpott.
|
|
|
|
|
hi,
I am having MDI form in my Project. I am calling child form through the below code. It's working fine.
Feedback childForm = new Feedback();
childForm.MdiParent = this;
childForm.Show();
But when I set background image on MDI form. It will not display the child form.
How can I do?
Thanks
sjs
|
|
|
|
|
You should not be seeing the background image on the MDI Parent at all since the background image is being shown behind the Parent's MDIClient area that handles the MDIChild forms.
You have to search through the Parent's Controls collection and find the MDIClient control, then set its BackgroundImage property. I'm not entirely sure it will work, but it's worth a shot.
|
|
|
|
|
Hi,
In my windows application, I have 2 treeview controls, say trvw1 and trvw2. I populate trvw1 from XML file. Selected nodes will be shifted to trvw2. When I select node1 after selecting node3 trvw2 appears as below.
trvw1 trvw2
------ ------
node1 node3
node11 node31
node12 node32
node2 node1
node21 node11
node3 node12
node31
node32
But in trvw2, node1 should appear above the node3 as it appears in the trvw1. The order of nodes should not get disturbed in trvw2 .
Could you help me to solve this problem. Thanks in advance..
modified on Wednesday, February 4, 2009 12:34 AM
|
|
|
|
|
Well, a horribly inefficient, but likewise easy method would be to use a BubbleSort, referring back to original TreeNode.
bool done = false;
int length = trvw2.Nodes.Count;
while(!done)
{
done = true;
for(int i = 1; i<length;> {
if(trvw1.Nodes.IndexOf(trvw2.Nodes[i])<trvw1.Nodes.IndexOf(trvw2.Nodes[i-1]))
{
done = false;
}
}
}
I would include the "NODE SWAP CODE," but I'm not anywhere that I can check syntax, so yeah.
Sorry if it doesn't work or if there are small errors - I'm working entirely off of memory.
EDIT: Fixed typos.
There is no knowledge that is not power. - Mortal Kombat
|
|
|
|
|
I'm working on a project for my Comp Sci class, so I figured I'd make a homebrew version of rock band/guitar hero, except with real instruments.
I was wondering if there is a way to capture the audio input in a stream, and then if there was a way to check the pitch of a particular point of that input stream.
Any help would be appreciated. Thanks.
There is no knowledge that is not power. - Mortal Kombat
|
|
|
|
|
Rock Band and Guitar Hero do not support real instruments.
You can capture the input, but I'm not sure how hard it is to work out a pitch, especially if it's a guitar, which can have vibrato, bent strings, whammy bar, etc.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Even capturing the input would be a good enough start from where I'm at.
I imagine I can learn how to manipulate the captured audio on my own - something about FFTs, I was reading. Makes me wanna play FF Tactics.
Is there any way I could convince you to post a link or snippet showing how to capture the audio?
There is no knowledge that is not power. - Mortal Kombat
|
|
|
|
|
|
Thanks, this should help a lot.
You must just be a a better searcher than I.
I'll let you see the finished project, if you want. Probably won't be done (to completion) until about late April though...
There is no knowledge that is not power. - Mortal Kombat
|
|
|
|
|
Hi, i have a application which have a button UPLOAD.
When i press upload, the code behind will create the URI, ftpwebrequest etc etc to establish a connection and does the method.fileupload.
How ever, the application hangs awhile it is being connected to the ftp server. when the connection done and finish uploading, then it unhang.
So issit possible to like when i click the UPLOAD button, it will print to a textbox saying "Uploading in progress.. please wait".
I tried adding this code
tbxoutput.Text = "Uploading in progress.. please wait" BEFORE the creating of URI etc etc. but it still hung..
Do i have to create a thread and put the creating in 1 thread and output text in another?
|
|
|
|
|
|
in the sample in msdn.
it has FtpState state = new FtpState();
but when i try this in my application, it does not seems to have ftpstate
|
|
|
|
|
FtpState is a sample class created in the same document. Scroll up or down and you will find it.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
i dont see any.. i scrol and up down ddint see any sample class
|
|
|
|
|
|
Hi,
Can someone please tell me how can I get the current ID from a table in SQL and incriment that number by 1 using a C# method?
The table looks like this:
Table: Person
Attribute: Id
Attribute: PersonId
Attribute: Person
The Id is auto generated by SQL. I would like C# to look what the current Id is and then incriment it by 1 when inserting the PersonId.
PS - If possible, can I do thisw in my C# code rather than SQL Stored Proc?
Illegal Operation
|
|
|
|
|
Well you would need to issue a Command to the db.
SqlCommand command ...
command.CommantText = "INSERT INTO customer (name, active) VALUES ('test', 1); SET @id=@SCOPE_IDENTITY();";
Would work
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
Illegal Operation wrote: The Id is auto generated by SQL. I would like C# to look what the current Id is and then incriment it by 1 when inserting the PersonId.
You said it does it by itself, AND you want to do it manually?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Please help me that i need to generate an ID(number) with country code(string) while selecting countries from Combo box,i am using only one table with values Country,Id,Name...etc: with OleDBConnection ACCESS,i need number Id's for each country separately,please help me someone as i am a novice in coding
thanks in advance
|
|
|
|