473,661 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help! need "translatio n" from C++

Hi,

I'm trying to play an AVI file from memory with MCI. The documentation is
great
if you want to play a file from a file but directly from memory... almost
nothing.

After hours of searching I found this:
http://support.microsoft.com/kb/q155360/
and after that:
http://binaryworld.net/Main/CodeDetail.aspx?CodeId=3780

Which describes how to do what I want... the problem is that the first code
is in C++ and the second in VB.

For the past few hours I've been trying to translate this into C# but
without any luck. This is what I have so far:

public const long MMIO_INSTALLPRO C = 0x10000;
public const long MMIO_GLOBALPROC = 0x10000000;
public const long MEY = 0x2059454D;

[DllImport("winm m.dll")]
private static extern long mmioInstallIOPr oc(long fccIOProc,
MulticastDelega te pIOProc, long dwFlags);

long retVal = mmioInstallIOPr oc(MEY, new CallbackDelegat e(IOProc),
MMIO_INSTALLPRO C | MMIO_GLOBALPROC );

private long IOProc(ref MMIOINFO lpMMIOInfo, long uMessage, IntPtr lParam1,
IntPtr lParam2)
{
.....
}

// NOTE1: I found the definition of MMIOINFO on the second link
Everytime I try calling mmioInstallIOPr oc I get this warning:
"A call to PInvoke function 'Media!MMedia.M edia::mmioInsta llIOProc' has
unbalanced the stack. This is likely because the managed PInvoke signature
does not match the unmanaged target signature. Check that the calling
convention and parameters of the PInvoke signature match the target
unmanaged signature."

I continue execution and see that the movie isn't loaded...

Could someone PLEASE help me with correct "translatio ns" of these methods?

Thank you,
sačo
Apr 18 '06 #1
4 2001
"Sačo Zagoranski" <sa************ *@guest.arnes.s i> wrote in message
news:e2******** **@planja.arnes .si...
Could someone PLEASE help me with correct "translatio ns" of these methods?


Use int (or Int32) instead of long. Long is 64 bits but the functions are
most likely expecting 32 bits.

You should be using direct show for this now as MCI is very old now.

Michael
Apr 19 '06 #2
Changing from long to int didn't help... I still get the same result...

As for the the second suggestion. Doesn't this mean that the user has to
have directx installed on his machine? I don't like this idea very much
since
this means that before the user could use my little player (100kb) he would
have to install 50MB of stuff (.net framework + directx)...

"Michael C" <no****@nospam. com> wrote in message
news:OE******** ******@TK2MSFTN GP02.phx.gbl...
"Sačo Zagoranski" <sa************ *@guest.arnes.s i> wrote in message
news:e2******** **@planja.arnes .si...
Could someone PLEASE help me with correct "translatio ns" of these
methods?


Use int (or Int32) instead of long. Long is 64 bits but the functions are
most likely expecting 32 bits.

You should be using direct show for this now as MCI is very old now.

Michael

Apr 19 '06 #3
"Sačo Zagoranski" <sa************ *@guest.arnes.s i> wrote in message
news:e2******** **@planja.arnes .si...
Changing from long to int didn't help... I still get the same result...
Some other parameter must be incorrect in length then or you have too many
params. Did you change the definition of the import or just the consts? Do
you need to use a multicast delegate? I'm not sure what effect this will
have but it might cause a problem.

As for the the second suggestion. Doesn't this mean that the user has to
have directx installed on his machine? I don't like this idea very much
since
this means that before the user could use my little player (100kb) he
would
have to install 50MB of stuff (.net framework + directx)...


That's true.

Michael
Apr 19 '06 #4
The first parameters are OK I think the problem might be with the delegate.
you asked about the multicast delegate...
I used it because I saw an example like this on the internet...
What other kind of delegate could I use to pass a callback function to that
method?

sačo

"Michael C" <no****@nospam. com> wrote in message
news:ei******** ******@TK2MSFTN GP05.phx.gbl...
"Sačo Zagoranski" <sa************ *@guest.arnes.s i> wrote in message
news:e2******** **@planja.arnes .si...
Changing from long to int didn't help... I still get the same result...


Some other parameter must be incorrect in length then or you have too many
params. Did you change the definition of the import or just the consts? Do
you need to use a multicast delegate? I'm not sure what effect this will
have but it might cause a problem.

As for the the second suggestion. Doesn't this mean that the user has to
have directx installed on his machine? I don't like this idea very much
since
this means that before the user could use my little player (100kb) he
would
have to install 50MB of stuff (.net framework + directx)...


That's true.

Michael

Apr 19 '06 #5

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

Similar topics

0
9870
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ********************************** package Celcom.Client;
0
2384
by: Steven Green | last post by:
I need some help to get a training grant. If you are responsible for hiring Oracle professionals please read on. I want to become an Oracle DBA and am seeking to take a DBA certificate program. In order to obtain the grant to pay for the training I need to show a demand for the skills I want to study. The department of employment and training provides a questionnaire that I need to have answered by three companies.
4
5594
by: Scott Holland | last post by:
HELP - Need to connect to DB2 database on AIX from NT server. Also AS/400 from NT Server -- I am experienced in ORACLE and a novice at DB2. What tools would be the equivalent of Net*8 or SQLNET in ORACLE that would allow me to connect to a database on a remote box (either AIX or AS/400)? I have read that DB2 Connect appears to be the ticket for the Db2 server if it is on AS/400 or OS/390. What if it is on AIX? Does the same tool...
1
1499
by: Dhiraj | last post by:
hello, everybody, this is Dhiraj here. I need help urgently, as i am getting error on my web page. The error is "Microsoft JET Database Engine error '80004005'" whenever i want to open links of my web page. please provide detail help if possible. with regards, Dhiraj.
3
2805
by: amanda | last post by:
Hope someone can help me with this - I've been staring at it stupidly for hours now, convinced there must be an easy way to achieve the results I want: I have a very large table recording every sale made by one of 90 salespeople (2 years of data), and the date the sale was made. I need a report that shows a list of the salespeople down the left hand side and then for each month the total number of sales and the total value of sales. I...
2
1626
by: Pasacco | last post by:
dear I want to ask help on this problem. Array a is partitioned into a0 and a1 in main(). Then a1 is partitioned into a2 and a3 in th_partition() function. And I think this problem is something about parameter passing. If someone give me comment, it will be thankful. thankyou very much
5
4082
by: Chad A. Beckner | last post by:
Hey all, I know this has been done using C++ (I have one with source code), but I don't know C++ that well. Does anyone know of a C++ to C# converter? - OR - does anyone know to to retrieve a web page as an image (not get an image from a web page)? I need to do this for an application I am working on (non-comercial) and can't seem to find any code or hints on how to do this. Thanks for any help!
2
1829
by: M Skabialka | last post by:
I installed Visual Studio Beta 2005 but setting up the SQL server was so complex I uninstalled it and put Visual Studio 2003 Academic on. I am totally new to Visual Studio and trying to teach myself from books and online classes. I tried to follow instructions to creating a new ASP.NET Web Application. The default location for this is http://localhost/WebApplication1 I hit OK then get this message: The Web server reported the...
4
2845
by: Web_PDE_Eric | last post by:
I don't know where to go, or what to buy, so plz re-direct me if I'm in the wrong place. I want to do high performance integration of partial differential eqns in n dimensions (n=0,1,2,3..etc) I want to do (fast) graphic output of the results. I used to use C. I want to upgrade my computer. Do I get dual core? Does C# support dual-core? Is C# as fast as the old C? Is there a new C? (or is C# the new version of C?) Is Visual Studio...
0
1795
by: riflefire | last post by:
Hello Everyone, I am using the new MITE c# text game engine to code up a MUD style game. I need a lot of help as i am new to C#. The reason i need the help is that the engine requires c# scripts to be written to run the mud. It also has a remote gui, code editor and other neat features. The mud i envision is a Science Fiction with a sub genre of being Christian Friendly. I know a rather different type of combination but very workable and what i...
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8855
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8758
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.