Quantcast
Channel: VBForums - API
Viewing all articles
Browse latest Browse all 168

Question about FourCCs and ICOpen function

$
0
0
According to https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx there are 3 fields to ICOpen, the first of which requires an "type" FourCC to tell it what type of compressor (audio or video) is being requested for opening. If it's video, it must have the FourCC "VIDC" according to MSDN, but MSDN never tells the proper way to convert this string to a number. Notice that the FourCCs in ICOpen require a 4byte integer for input, not a four character string. So there's 2 possible ways to convert the string "VIDC" to an integer.

1:
Treat the string in memory as if it is an integer. The leftmost character corresponds to the least significant byte of the integer. For "VIDC", this corresponds to the integer 0x43444956

2:
Treat the string as if it is a number being displayed, with the leftmost character corresponding to the most significant byte of the value. For "VIDC", this corresponds to the integer 0x56494443

I'm not sure which way is the correct way to convert a string to a FourCC. I want to do it right, so I don't crash my program when it tries to execute ICOpen, as in VB6, any time you encounter an API error, the entire VB6 IDE crashes. Normally, if I was just working with pure VB functions, I'd just try both ways, to see which worked, but I'm working with API functions here and I don't want to crash the IDE.

Viewing all articles
Browse latest Browse all 168

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>