Is it possible to convert C++ code into VBA language? If yes then how do I do this?
(I have no experience/knowledge of C++)
Is it possible to convert C++ code into VBA language? If yes then how do I do this?
(I have no experience/knowledge of C++)
*******************************************************
HELP WANTED! (Links to Forum threads)
Trying to create reusable code for Custom Events at Workbook (not Application) level
*******************************************************
Hi
http://www.tangiblesoftwaresolutions...r_Details.html
I have no idea if this works..
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
That's only for .net marvin. It depends on What the code does, you can do things in c++ that you can't in excel
OK. Do you think it would be possible to convert the C++ code found here:
http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
which I think is a function called from the C++ code here:
http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
If it helps, I'm not seeking to convert all the code on these two pages. I'm only interested in the portion that will: "get the size by passing the first 24 bytes of the Header Object to the IMFASFContentInfo::GetHeaderSize method"
I'm trying to convert it but it is not easy (seeing as I have never learnt C++). What is this hr that appears a lot? Is hr the function result?
![]()
Please Login or Register to view this content.
It's an HRESULT which is a Long indicating the result of the function.
Everyone who confuses correlation and causation ends up dead.
what is DWORD? Is this a datatype? What is SUCCEEDED? It doesn't appear to be a function in the code so is it some C++ inbuilt function??
![]()
Please Login or Register to view this content.
This is a good list of types: http://codingdomain.com/visualbasic/win32api/datatypes/
I don't think SUCCEEDED is built-in but it just tests if the value passed to it is >= 0.
Thanks again Rory
Well the code has less red text these days (see below) but I'm still in over my head.
What is all the ->Lock ->Read etc?
They seem to have some connection to the IMFMediaBuffer and IMFByteStream. I'm not sure what these are either. After googling I'm now thinking these could be APIs? Can anyone please confirm/deny?
![]()
Please Login or Register to view this content.
They are data types, not API functions.
You can't just ignore this part of the code, it's probably one of the most important parts of the code.
![]()
Please Login or Register to view this content.
If posting code please use code tags, see here.
They are currently shown as data types in VBA because i made a guess at the time as to what they were. So you are saying my first guess was right?
If they are data types then how can they can do things like?![]()
Please Login or Register to view this content.
How do I recreate these in VBA or am I unable to because they are data types native to C++?(pls don't laugh, I have never used C or C++ languages)
They aren't declarations, they are compiler directives http://www.cplusplus.com/doc/tutorial/preprocessor/.
Last edited by Norie; 05-23-2014 at 07:39 AM.
Thanks for pointing me to this. However as I have no knowledge of C++, I'm finding the tutorial confusing.
Quote:What does it mean by 'headers'?Source file inclusion (#include)
This directive has been used assiduously in other sections of this tutorial. When the preprocessor finds an #include directive it replaces it by the entire content of the specified header or file. There are two ways to use #include:
12
#include <header>
#include "file"
In the first case, a header is specified between angle-brackets <>. This is used to include headers provided by the implementation, such as the headers that compose the standard library (iostream, string,...). Whether the headers are actually files or exist in some other form is implementation-defined, but in any case they shall be properly included with this directive.![]()
Unsolved. Closing thread because I only wanted to port C++ code to create one function in VBA.
Which I have worked out myself.
http://www.excelforum.com/excel-prog...structure.html
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks