Archived

This topic is now archived and is closed to further replies.

mickey

when i start my app and press a key for the first time my app hangs for a while...

Recommended Posts

it''s because the dlls are being loaded.., and i don''t want that because the objects in my game are already moving and whenever that happens and finishes, the objests are misplaced, gets stuck, jumps and all other nasty things, probably because i moved my object based on time, so if i loaded the dlls at start manually, will i still get this sort of situation? or what other solutions are there? thanks,

Share this post


Link to post
Share on other sites
Afternoon, mickey.

It has absolutely nothing to do with dlls being loaded, as they''re loaded *before* your application executes.

You''re *supposed* to move your objects based upon time, so the problem isn''t that either.

How about showing your object-movement code? or how your timing is initialized/updated?

Cheer,
Scronty

Share this post


Link to post
Share on other sites
hiya Scronty,

they are loaded before? how come i see at my visual studio outwindow that they are being loaded whenever i press a my first key?

anyway, that''s just really my problem, visual studio loads the dll once i pressed my very first key,

Share this post


Link to post
Share on other sites
What you see in the Visual Studio output window is not related to when it actually happens. VS updates that window when it gets a chance to. I''ve had situations where nothing appeared in the VS output window until my program ended.

Scronty''s right - the DLLs are loaded when your exe loads. (Actually, most of them are probably already loaded and your application just links to them at startup, but that''s another topic.)

Share this post


Link to post
Share on other sites
quote:
Original post by Dave Hunt
Scronty''s right - the DLLs are loaded when your exe loads.


Not always. There are DLL''s that are loaded implicitly (linked with an import library) and those loaded explicitly (loaded with LoadLibrary). Explicitly loaded DLL''s are not mapped into the processes address space until the call to LoadLibrary.

Share this post


Link to post
Share on other sites
either way, i''m assuming you have a timer to move stuff based on time. just check and see if that result is greater than a second or half a second or something, and if it is set the time elapsed to 0 until it stops spiking. thats how i get it to not move everything for miles after you alt tab it for a while.

Share this post


Link to post
Share on other sites
quote:
Original post by mickey
hmm okay but why does my app stops for a sec everytime i press my first key? any ideas? even if i make a release build,


mickey - We don''t know. We still haven''t seen any of your code.

Solo - that''s true, but I made the assumption (based on the level of the question) that he wasn''t explicitly loading any DLL''s.

Share this post


Link to post
Share on other sites
hi dave,

i don''t think there''s any use if i post some codes here, even there''s nothing on the screen except some texts like fps, camera position using the CD3DFont class, i can see the numbers jumping whenever i press my first key...,

doesn''t this thing happen to you? so you mean, you run your app, and the first time you press a key your app won''t hang for half a sec.?

Share this post


Link to post
Share on other sites
quote:
Original post by mickey
i don''t think there''s any use if i post some codes here, even there''s nothing on the screen except some texts like fps, camera position using the CD3DFont class, i can see the numbers jumping whenever i press my first key...


You don''t KNOW whether posting your source code will help, since you don''t know what your problem is. I can tell you one thing, tho... you definitely WON''T get help if you DON''T post source code.

quote:
doesn''t this thing happen to you? so you mean, you run your app, and the first time you press a key your app won''t hang for half a sec.?


No. It''s something you''re doing wrong. Sorry to be blunt, but there ya go.


Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites
hiya guys,

my problem went away, well sort of, i saw almost all the dlls being loaded on my output window once i start running my app in vstudio so when i pressed the first key, only 3 dlls were being loaded so therefore there weren''t any hang...,

weird, anyway thanks again people for all the time, sorry to bother you with these questions, i''ll just put in my head that "it shouldn''t happen(the hang thing)"

Share this post


Link to post
Share on other sites