|
Well there is E[^] and F#[^] and probably a lot more, but they didn't get their own CP forum yet...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Yeah, just because its in an aspx page, doesn't make it a c# problem. And besides, isn't there an ASP .NET section anyways?
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
I have a C++ dll. I would like to use a C# to access two methods within that dll. What is the best way to do this. I cannot seem to find much information on getting the C# app to talk to the C++ dll.
Is this possible?
If so, how?
Thanks,
cw
|
|
|
|
|
|
I tried placing
[DllImport("My.dll")]
static extern int MakeQUERY(string strTag) ;
Inside my C# class. The call MakeQUERY is in my C++ dll.
But when i try to build this, i get an error:
"The type or namespace name "DllImport" could not be found(are you missing a
using directive or an assembly reference)
|
|
|
|
|
Yeah, that happens a lot.
It typically means you are missing a using directive or an assembly reference
(and probably both).
Have a look at some other program that tries to do what you are trying, i.e.
search CodeProject (or Google) for "DllImport"
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
You will need to add this one line to able to use DllImport.
using System.Runtime.InteropServices;
Cheers.
------------------------------------------------------------------
Life would have been much easier if I had the source-code!!
|
|
|
|
|
Thanks that got me further.
Now it is throwing a System.EntryPointNotFound error.
My dll looks like this.
#include "stdafx.h"
#include "Mydll.h"
#include <atlcomtime.h>
#include <tchar.h>
#include <vector>
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
DLL_API MakeQUERY(LPCSTR strTH, LPCSTR strEH, LPCSTR strSenderID, std::string strPath)
{
}
I added this to my C# declaration
[DllImport("LCIBroker.dll", EntryPoint = "DllMain")]
But it still cannot find the EntryPoint. Is there something that i am missing?
|
|
|
|
|
I have a webform.aspx like this :
<body MS_POSITIONING="GridLayout"><br />
<form id="Form1" method="post" runat="server"><br />
<asp:Panel id="Panel1" style="Z-INDEX: 102; LEFT: 24px; POSITION: absolute; TOP: 24px" runat="server"<br />
Width="210px" Height="272px">Panel <br />
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1"><br />
<TR><br />
<TD><br />
<OBJECT id="Player" style="WIDTH: 121.92%; HEIGHT: 265px" height="265" width="121.92%" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"<br />
VIEWASTEXT><br />
<PARAM NAME="URL" VALUE="path"><br />
<PARAM NAME="rate" VALUE="1"><br />
<PARAM NAME="balance" VALUE="1"><br />
<PARAM NAME="currentPosition" VALUE="1"><br />
<PARAM NAME="defaultFrame" VALUE=""><br />
<PARAM NAME="playCount" VALUE="10"><br />
<PARAM NAME="autoStart" VALUE="-1"><br />
<PARAM NAME="currentMarker" VALUE="0"><br />
<PARAM NAME="invokeURLs" VALUE="-1"><br />
<PARAM NAME="baseURL" VALUE=""><br />
<PARAM NAME="volume" VALUE="100"><br />
<PARAM NAME="mute" VALUE="0"><br />
<PARAM NAME="uiMode" VALUE="full"><br />
<PARAM NAME="stretchToFit" VALUE="0"><br />
<PARAM NAME="windowlessVideo" VALUE="0"><br />
<PARAM NAME="enabled" VALUE="-1"><br />
<PARAM NAME="enableContextMenu" VALUE="0"><br />
<PARAM NAME="fullScreen" VALUE="0"><br />
<PARAM NAME="SAMIStyle" VALUE=""><br />
<PARAM NAME="SAMILang" VALUE=""><br />
<PARAM NAME="SAMIFilename" VALUE=""><br />
<PARAM NAME="captioningID" VALUE=""><embed src="path" width="100%" height="223" autostart="1" align="middle" url="path" volume="100"<br />
stretchtofit="100%"> </embed><br />
</OBJECT><br />
</TD><br />
</TR> </TABLE><br />
<br />
</asp:Panel><br />
</form><br />
</body>
And a webform.aspx.cs like this
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
Utility = new CCUtility(this); <br />
string id_bh = Request.QueryString["item_id"];<br />
id_BH = Convert.ToInt32(id_bh) ;<br />
string sSql = "SELECT Link FROM tblBaiHat WHERE id_BaiHat='" + id_bh + "'";<br />
SqlDataAdapter dad = new SqlDataAdapter(sSql,Utility.Conn);<br />
DataSet dts = new DataSet();<br />
dad.Fill(dts,"tblBaiHat");<br />
path= (string)dts.Tables[0].Rows[0]["Link"];<br />
Panel1.DataBind();<br />
}
Variable path look like 'D:\song.wma' for example.
Why WMP can't play this song.Help me please !
-- modified at 13:56 Tuesday 23rd October, 2007
nothing
|
|
|
|
|
whale84 wrote: string sSql = "SELECT Link FROM tblBaiHat WHERE id_BaiHat='" + id_bh + "'";
Can you spell SQL Injection[^]?
As for the rest - are you assigning the path to the media player at all? Doesn't look like it.
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton
|
|
|
|
|
HI i just created a setup project of my c# application. the primary output has been added to the application folder. and i am getting the default path as c:/programfiles/productname....
i want to change that, i mean i need the default installation flder as c:/productname....
My small attempt...
|
|
|
|
|
Right-click the Application Folder in the left pane and choose Properties Window from its Context menu. In the Properties Window, notice that the DefaultLocation property contains the information that defines the default installation location. The items in brackets are tokens that get replaced when the user is running the setup program. The Manufacturer token pulls its value from the company name you entered when you installed C#.
Visit my blog at http://dotnetforeveryone.blogspot.com
|
|
|
|
|
Hi all,
I have a listbox and i have some items in it but when i select these items
, these items flicker .
so, can anyone help me how can i solve this problem?
Praveen Sharma
|
|
|
|
|
Hi,
when the selection changes, the affected items get painted again.
1.
Is the ListBox painting itself (not userdraw)? if so:
Are your ListBox items simple strings? or complex objects whose ToString() takes some time?
2.
Is the ListBox userdrawn? if so:
is your DrawItem handler taking some time, e.g. fetching data from a database?
Maybe showing some code would help us help you.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi,
I am trying to create a setup program to deploy a .net 2 web app. When I right-click on the setup project and then go Add -> Project Output, I only see "Content Files" in the Add Project Output Group dialog box. Why do I not see the other options like "Primary output".
Any help would be greatly appreciated. Thanks in advance.
Regards,
|
|
|
|
|
hei.. add a new sepup project in the same solution ... then right click that setup project u wil see "add"... from there you can see "project output" . upon selecting that optio you will get the provision to select the primary output . please check the combo box which is at the top, it will contain the project name.
My small attempt...
|
|
|
|
|
I can see "primary output" for a Windows project but Not for a Web Project? Can you see it for a Web Project?
|
|
|
|
|
what are you going to do with "setup" for web project. want to install web page anywhere.. are you crazy????
My small attempt...
|
|
|
|
|
|
Thank you very much J4amieC for this vital piece of information, that for some reason is not mentioned in either of my two books on C# 2008 (at $60 and $40, less a cent each)!
And having done much of my C++ development with the Borland C++ Builder, this was not entirely obvious.
Fred,
(Another BCB Fan)
|
|
|
|
|
hy everyone!
i was asked to do the following:
i do have an access database which contains a list of account infos. the view looks like this:
acc_id subacc_id acc_name acc_child
the first column contains an index number, the second one is either 0 or an acc_id number (if 0 then it is a parent account, otherwise it is a child account of the parent account, which number is found in the subacc_id). the third filed is the name of the account. and the last one is a counter of how many children are available for the parent account.
what i want to do now:
i want to create a (hierarchical) treeview of this situation. so when it is a parent then it is layer 1, if it is a child then it will be located in layer 2 (so child to the refered parent). on the other hand i do also want to insert the infos of the selected element in some outputfield, meaning the columns of the selected element.
my problem is, i did a lot of c# programming, but i have never done this before. the user interface is quit simple but it has to be filled as well.
so to summarize what i want to do:
1) enter the elements out of the database (row by row) in a (hierarchical) tree view (with parent nodes and child nodes)
2) when an element in the treeview is selected then the infos (which acc_id, which childacc_id, which acc_name and the number of children) have to be displayed in some textfields.
could someone help me out of this please?
by the way: is the collapsing and expanding of the treeview done automatically or do i have to code this as well.
thanks again for your help.
stephan.
|
|
|
|
|
Have you tried searching i) CodeProject ii) MSDN documentation iii) Google for information?
The scenario you describe is quite common; there will be plenty of examples on the web to populate a TreeView control. I suggest you do some research, attempt to solve the problem yourself and post back if you encounter any specific difficulties.
Paul Marfleet
|
|
|
|
|
i already did but it confused me more than it helped
i already had a look at codeproject and google, but it didn't really help me.
well to add the infos in the textboxes is very simple. and i guess to add a new node will be as well, but my number one problem is: how do i read from the database, how do i access it? do i have to access it like a textfile or am i able to address the fields? i included the source to my project, so the first step is done ...
well i will try to find out some more details, but if someone could provide me some further infos as well this would really help. (maybe even a link to a page which describes my problem). because all the things i found didn't work or help me so far.
|
|
|
|
|
This article[^] shows you how to fetch data from an MS Access database using C#. It should be straightforward to modify the example to populate a TreeView control.
Paul Marfleet
|
|
|
|
|
Iam using two forms in a windows appln. How can I access the control of the second form from the first form.
Thank you
|
|
|
|