|
could you provide some sample code of how to do this? I thought of doing that, but I couldn't get it to work.
Thanks,
-----------------
Genaro
|
|
|
|
|
picazo wrote: could you provide some sample code of how to do this? I thought of doing that, but I couldn't get it to work.
Since you've already written code to convert String^ to BSTR, I presume your problem is with converting that to a VARIANT. To do that, you can use _variant_t which has a constructor that takes a BSTR, and use that. You can pass _variant_t anywhere a VARIANT is expected.
|
|
|
|
|
Hey Guys,
I have a simple DLL file that performs an smtp email function for one of my applications. The problem with the DLL is - it sends an OK dialog box to the user once the email has successfully been sent. I was wondering if it were simple enough for you to remove the OK dialog box from the DLL.
If successful the OK dialog box should not appear after the email has been sent.
Can a DLL be changed like this, or do I have to create a new one altogether?
Thank you,
Stephen
Big Steve
Independant programmer for small business. Client management solutions
(888) 263-2690
|
|
|
|
|
It depends if you have the source code or not, I suspect not.
If the functionality of the DLL is not too large, then I would just rewrite it - it would be much quicker than trying to hack the DLL.
|
|
|
|
|
I have posted this under Visual Studio too as i was unsure of the correct fourm.
I have a Crystal Report 10 report which i need to use in my app. I use Managed solution for this. There are no compiler or linker problems. I am not able to display this report on the screen but am able to print the report. I tried all member methods - Visible, Show, BringToFront, set_Size etc. Am i missing something.?
Here is the code snippet for your ref:
crReportDocument = new ReportDocument();
// MessageBox("Report Document Instance Created", "New Reports");
crReportDocument->Load("BATCHSQL.RPT");
// MessageBox("File Loaded to Report Document Instance ", "New Reports");
//Setup the connection information structure to be used
//to log onto the datasource for the report.
crConnectionInfo = new ConnectionInfo();
// MessageBox("Connection Info set", "New Reports");
//Get the table information from the report
crDatabase = crReportDocument->Database;
crTables = crDatabase->Tables;
// MessageBox("Start Looping through all tables in the REPORT", "New Reports");
//Loop through all tables in the report and apply the connection information for each table.
// MessageBox("Show the Report", "New Reports");
//Set the viewer to the report object to be previewed.
crViewer = new CrystalReportViewer();
crViewer->ReportSource = crReportDocument;
// MessageBox("View the Report", "New Reports");
crViewer->Location = System::Drawing::Point(60, 60);
crViewer->Size = System::Drawing::Size(750, 750);
crViewer->Show();
crViewer->BringToFront();
crViewer->Visible = TRUE ;
crViewer->RefreshReport();
crViewer->Zoom(200);
crViewer->DisplayToolbar = TRUE ;
crViewer->DisplayBackgroundEdge = TRUE;
// crViewer->PrintReport(); ---- This works
MessageBox("Refreshing of the Report Complete", "New Reports");
Any suggestions?
Thanks,
Madhu

|
|
|
|
|
Hello,
I was using extern functions like:
<br />
extern "C" <br />
{ <br />
__declspec (dllimport) int TextExtern(int sizel);<br />
<br />
}
in MFC, when I try to use this with CLI it takes such a long time to load this function that it is imposible to use this function. Just in case this extern function TextExtern is writed in FORTRAN
Can anybody help me??
Thanks,
Best regards
|
|
|
|
|
http://users.volja.net/bsaksida/co.zip
if you look for ListViewFlickerFree, you can see the function ValidateRect has ben used from user32.dll
|
|
|
|
|
Hi i've been struggling for two days now, the Client Server application I wrote runs perfect when my pc runs the server and the other pc connect to it. but if i change the host ip on the client program and run the server on any other pc I get the the
SocketException : No connection could be made the target machine activly refused it
I've tried every thing even removed the firewall's on all the comuters
can any one help me...?
thanx in advance
|
|
|
|
|
Are you positive no firewalls are blocking the listen port? Are the port settings correct?
Is the server succesfully binding and listening on the correct port?
Also are there any permissions required for the user context the server runs in on other machines
(just a wild guess/thought)?
|
|
|
|
|
Hi all. How come i get the error that i _beginthread is a undeclared identifier ? When i clearly have #include <process.h> ????
This is strange. Im using the VC++ 6 compiler and MS 2003 SDK - i hope these arnt the problems. Thanx in advance.
|
|
|
|
|
You've defined _WIN32, _X86_ (or the appropriate processor define), and included
#include <process.h>
?
|
|
|
|
|
Yes, i dont know why what i typed was a bunch of question marks. But it was #include < process.h >
|
|
|
|
|
hmmm does #include <windows.h> need to be before the process.h include?
Other than that all I can think of is old header files (it compiles fine for me on VS 2003).
Mark
|
|
|
|
|
1 more thought - you are compiling for multithread right (/MT)?
|
|
|
|
|
OK. So I'm trying to create a custom control in a C++/CLI project. I create it, build it, it gets added to the Toolbox, everything is happy -- until I try to add the control to a Windows form. As soon as I drag the custom control from the toolbox to the form, I get the message "Failed to load toolbox item <insert name here>. It will be removed from the toolbox."
So I took a "back-to-basics" approach and tried to create a user control that merely encapsulates a textbox. Nothing else added. Just a plain old text box. I get the same $@#$@#%!#% message.
So at this point I figure either I'm just stupid or else there's something seriously wrong with my installation of Visual Studio (2005 Professional). Can someone point me to a good step-by-step article on creating custom user controls specifically in C++/CLI? Or does anyone have an idea why I'm getting this message?
Thanks.
-- modified at 11:18 Wednesday 10th January, 2007
|
|
|
|
|
http://users.volja.net/bsaksida/co.zip
this is my project, If you woud look for ListViewFlickerFree, you can see how to create custom control
|
|
|
|
|
Thanks. I've downloaded it and I'll take a look.
|
|
|
|
|
Bsaksida,
Just wanted to follow up with you. Thanks for that sample project. At first glance, it appeared I was doing everything correctly, but a little deeper digging revealed the problem: My project is built with the /clr option rather than /clr:pure. Once I moved my custom control into a separate DLL project built with the /clr:pure switch, I was able to bring that control into forms in the main project with no problem.
Thanks again,
xpnctoc
|
|
|
|
|
The reason i put in dll, was because sometimes a IDE desing bisplayed errors instead design if it wasn't in dll.
|
|
|
|
|
I have two projects, one "Visual C++/CLR/Class Library" (DLL file) and one "Visual C#/Windows Application"
The DLL file:
namespace Foo<br />
{<br />
public ref class RC<br />
{<br />
public:<br />
static const System::Int16 value = 0;<br />
};<br />
<br />
public enum class EC : System::Int16<br />
{<br />
value = 0;<br />
};<br />
}
In the application I have the following problem:
static class Program {<br />
static void Main()<br />
{<br />
Int16 sh = Foo.EC.value;
switch(sh)<br />
{<br />
case Foo.RC.value:
MessageBox.Show("Information");<br />
break;<br />
}<br />
return 0;<br />
}<br />
I need to solve one of these problems (which one is not that important), i.e. to have implicit type casting from an enumeration to a short (or other type of integer), or to get a "static const" defined in MC++ to actually be a constant value.
I have looked all over the net trying to find a solution for this, but it seems that this behaviour actually is what is intended, is it really so?
Forgot to add, I am using VS 2005, i.e. .NET 2.0
-- modified at 5:37 Monday 8th January, 2007
Internet - the worlds biggest dictionary
|
|
|
|
|
The enum should not be derived from Int16.
Use the enum type name in c# not Int16 and you should be right
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
Seems like I did not explain my problem good enough;
What I need is some way of having a constant value in MC++ as an integer of any size (have several of them, some 16-bit, some 32-bit and some 64-bit), and I need the value to be viewed from C# as constant.
When trying it as a "static const" value, as seen in my question, the compiler does not regard this as a constant value. When searching forums I found out that this is what the compiler should do, becase "static const is not const" or similar quote, and I found the suggestion of having it as a typed enumeration (i.e. public enum class NAME : TYPE), just as seen in my question.
The downside on doing this is that an enum is not implicitly casted to an integer, and then I have to write:
int i = (int) myEnum.value;
with the explicit type cast each time. This is the same both with and without the enum being derived from an integer, I have tried both.
What I am hoping is that I am not the only one who have tried this, and that someone out there has found a way of doing this, but since I have googled this it does not seem like this, so that is why I asked here.
Internet - the worlds biggest dictionary
|
|
|
|
|
ShermansLagoon wrote: get a "static const" defined in MC++ to actually be a constant value.
It is a "const". That means it is immutable. That is not the same thing as a compiler constant that is required for a case statement. C# is not C++, it has it's own definition of required const's for a case statement. I believe you need to use a different design for whatever your goal is.
led mike
|
|
|
|
|
Ahh, ok, I understand the difference between "immutable" and "compiler constant" now. Thank you for clearing that up, lead mike.
So what I am looking for then is a way of having a "compiler constant" integer value defined in MC++, encapsulated in a .DLL class library and then regarded by C# as a "compiler constant" and as an integer value. With a "static const" it is regarded as an integer value, and the "enum class" definition is "compiler constant".
Is this possible, or should I just give up?
Internet - the worlds biggest dictionary
|
|
|
|
|
ShermansLagoon wrote: So what I am looking for then is a way of having a "compiler constant" integer value defined in MC++
So you say, but what is the actual problem you are trying to solve. It is very likely that a different design will solve it without that requirement.
led mike
|
|
|
|