|
I don't think so, at least the way they are written; they will be declared as two distinct arrays in memory.
If you want to optimize memory usageage for shared strings, you can have a look at the Trie data structure[^].
This signature was proudly tested on animals.
|
|
|
|
|
thank u.
but i donot want to optimize memory usageage for shared strings only, i just want to optimize all my stack memories in use if i can...
|
|
|
|
|
Looks like alignment padding and shouldn't hurt anything, but can be confusing if you're looking at the raw data and not expecting it. If you really wanted to you could change structures to align on a byte.
|
|
|
|
|
yes,this is a good method.
but if couldnot change the structure,have any other good ways?
i think this is a good question now.
|
|
|
|
|
Unless you are forced to decide yourself the memory layout (for example to be compatible with some other pre-existing code) don't worry about that.
Your arch1 and arch2 are distinct arrays and the compiler place them at the beginning of a 32bit block so that the processor access speed can be optimum.
You can alter this behavior with the #pragma pack directive, setting the packing to 1 byte you'll get what you expected. But -if you're not explicitly required to do that- let the compiler to do its job and decide by itself how to place variables.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
pragma cannot resolve this question...
|
|
|
|
|
I need to change the playback rate of a video file. The IMediaSeeking interface has a SetRate method which is supposed to do this - but I get an E_INVALIDARG when I pass the new rate. I have FiltrGraph manager which has a Source filter (using the AddSourceFilter method), a GrabberFilter and a NULL Renderer. (Changing the Null Renderer to a default renderer did not change the result - I am still not able to show the video in slow motion or fast forward (speeded up). If SetRate is the correct way to do it, is there sample code I can look at? (Will be happy to post my code here if needed). If there is another way to do this, I am open to all suggestions.
Thanks in advance
|
|
|
|
|
rajas wrote: but I get an E_INVALIDARG when I pass the new rate.
What rate do you pass (i.e. Could you please post the code?)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
Can anyone tell how to write a program to combine both win32 and MFC for creating a window and exchange messages from each other in a project.
nss
|
|
|
|
|
Since MFC is a class library written on the top of Win32 API (it is -or was- actually a thin wrapper), then in every MFC project you are free to mix the two.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello! You can look through articles here on CodeProject or go to:
http://www.functionx.com/visualc/[^]
Tutorials will help you get an understanding how to use Visual Studio and MFC to create dialog box applications. Good luck!
|
|
|
|
|
Thank you.
Anyway, I suppose the OP would be more interested...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
Would like to write a program using MFC to display png format of symbols on the display. Can anyone provide me details,from where I can get the details to start with?.Thanks in advance.
nss
|
|
|
|
|
there are dozens of PNG-related articles on CodeProject.
try the Search box.
|
|
|
|
|
MFC/ATL class CImage [^] supports the png format. You may also use directly GDI+ classes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Greetings - my first question so please forgive any faux-pas I make..
My Win32 application loads a number of embedded Web browsers, each of which load and play a Flash movie.
I want to find a way to control the volume of each loaded Flash movie independently of each other. My target platform is Windows XP so I can't use the mixer APIs that I hear are available on Vista and 7.
Here is the code with error checking etc. removed (I'm using a very simple Flash API call to test)
HMODULE hFlashDLL = GetModuleHandle( "NPSWF32.dll" );
typedef void (__stdcall *flash_func)();
flash_func flash_stop_func = (flash_func)GetProcAddress( hFlashDLL, "native_ShockwaveFlash_StopPlay" );
flash_stop_func();
hFlashDLL and flash_stop_func appear to be valid but when I call the function itself I get an access violation.
Should this work and I'm missing something obvious in my code or is this sort of thing just disallowed in Win32?
Any pointers appreciated.
|
|
|
|
|
opensoar wrote: HMODULE hFlashDLL = GetModuleHandle( "NPSWF32.dll" );
Did you try this:
HINSTANCE hLib = LoadLibrary(_T("NPSWF32.dll"));
|
|
|
|
|
I did and I get the same access violation error. Even if it worked though, wouldn't that just let me control an instance of Flash that I load versus an instance loaded by the browser (which is what I want)?
I think each browser instance must load it's own version of the plugin or controlling Flash parameters in one would control them all.
|
|
|
|
|
opensoar wrote: HMODULE hFlashDLL = GetModuleHandle( "NPSWF32.dll" );
Are you sure that this dll is loaded into memory at this point? You don't error check the returned value hFlashDLL .
MVP 2010 - are they mad?
|
|
|
|
|
Yep - it's loaded. Like I said in my original message, I listed the code with error checking etc. removed and the values I get back seem ok.
|
|
|
|
|
opensoar wrote: hFlashDLL and flash_stop_func appear to be valid but when I call the function itself I get an access violation.
My apologies, I missed this in your original post. Is there any more information from the access violation to give any indication of what it is complaining about? Also are you sure that native_ShockwaveFlash_StopPlay does not require any parameters?
MVP 2010 - are they mad?
|
|
|
|
|
>> Also are you sure that native_ShockwaveFlash_StopPlay does not require any parameters?
That was my thought too Richard - docs are a bit thin on the ground and that function name doesn't match any in the the other Flash API docs I've seen so I'm thinking those calls are wrapped somehow and that my part of the problem.
Nothing more useful in the error message as far as I can tell.
|
|
|
|
|
I just Googled native_ShockwaveFlash_StopPlay and found one hit; someone else complaining of the same issue. My only suggestion is to try and get some documentation on this library from someone else around the world.
MVP 2010 - are they mad?
|
|
|
|
|
Hi Members
How i get Screen capture?I am using dialog based application i want to get Screen capture and save into .dat format.
Please help me
|
|
|
|