473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

DLL import in C#: function parameters conversion problem

Hi all,

please can You help me with translation of function parameters provided by
p2smon.dll library (Crystal Reports)? Any example, which I found, is only in
VB (I don't like it :-)

I would like use this function for runtime creating of reports ...

function name:
-------------------
CreateReportOnRuntimeDS()

Parameters:
--------------

Declare Function CreateReportOnRuntimeDS Lib "p2smon.dll" (
lpUnk As Object,
ByVal reportFile As String,
ByVal fieldDefFile As String,
ByVal bOverWriteFile As Long,
ByVal bLaunchDesigner As Long
) As Long

Parameter Description
------------------------

LpUnk - The active data source used to create the field definition file. In
C or C++, this is a pointer to an IUnknown derived COM interface relating to
a DAO or ADO Recordset. In Visual Basic, this is a Recordset or Rowset
object.

ReportFile - The path and file name of the report file to be created.

FieldDefFile - The path and file name of the field definition file to be
created.

BoverWriteFile - If a field definition file already exists with the
specified path and file name, this flag indicates whether or not to
overwrite that file.

BlaunchDesigner - If True (1), Crystal Reports is launched with the newly
created report file opened. Crystal Reports must be installed on the system.

Nov 15 '05 #1
1 2009
Martin,
Declare Function CreateReportOnRuntimeDS Lib "p2smon.dll" (
lpUnk As Object,
ByVal reportFile As String,
ByVal fieldDefFile As String,
ByVal bOverWriteFile As Long,
ByVal bLaunchDesigner As Long
) As Long


If that works in VB6, I'd try this in C#

[DllImport("p2smon.dll")]
static extern int CreateReportOnRuntimeDS(
[MarshalAs(UnmanagedType.Interface)] ref object lpUnk,
string reportFile,
string fieldDefFile,
int bOverWriteFile,
int bLaunchDesigner);

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Anthony Robinson | last post by:
I have an issue I've been working on that has proven to be quite troublesome. I already have an idea of what the anwser may be, but would like to solicit some suggestions or other ideas from you...
3
by: deko | last post by:
I've been trying to use the Access Import Wizard to expedite importing data into my mdb. The nice thing about the wizard is that I can import from different file formats - txt, xls, even Outlook -...
89
by: Sweety | last post by:
hi, Is main function address is 657. its show in all compiler. try it & say why? bye,
2
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType =...
3
by: Beta What | last post by:
Hello, I have a question about casting a function pointer. Say I want to make a generic module (say some ADT implementation) that requires a function pointer from the 'actual/other modules'...
1
by: John Kotuby | last post by:
Hi all, I am working on porting an application from VB6 to VB.NET 2003 and am running into some problems. When declaring and populating the parameters for a SQL Stored Procedure by using the...
5
by: aaragon | last post by:
Hi everyone, I wrote a very simple function to try to understand the casting of variables in C++. The function is function foo() { std::vector<inttest(100); randomize(test); unsigned long...
6
by: cppnow | last post by:
Hello. I have a strange conceptual problem I'm trying to think about. I would like to build a library that allows the user to do the following: 1) User defined types: The user defines their...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.