|
Cool.
What are the exact linker errors?
From the code you've shown, the COM module shouldn't know
anything about a CString in the library code.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Suppose two processes are communication through Namedpipes and one of them gets killed.
Then how will the first process come to know that second process got killed.
Any kind of help would be welcome.
|
|
|
|
|
A read or write on the pipe will fail.
I would guess the error will be ERROR_BROKEN_PIPE...test it
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm working with directX and I have noticed that this function take some time to complete.
150 calls for this function take several seconds (3 seconds).
Is there any way to make this faster ?
|
|
|
|
|
I never used DirectX myself but I suppose that it is a normal behavior. I suppose that the function will load data from the file, which is always a "slow" process. Do you need to load 150 different images ? Because then your software is not very optimized. The best way to tackle this is to use a unique resource manager (make it a singleton for example) from which you will load your textures. The manager will cache the textures internally so that later, if the same texture is needed, it is returned directly, no need to reload the file once again. This has another big advantage: you just have one copy of the same texture in memory (instead of having 150 instances of the same texture, which of course takes a LOT of memory).
Hope that helps.
|
|
|
|
|
Thank you. I'll probably do something similar.
Anyhow my suspicion was that there may some other way to create the IDirect3DTexture from file which will be more faster. like some other function or specify some arguments since my use of the texture is very specific and perhaps not require all the smart things that gets computed when I call D3DXCreateTextureFromFile().
|
|
|
|
|
Hanan888 wrote: like some other function or specify some arguments since my use of the texture is very specific and perhaps not require all the smart things that gets computed when I call D3DXCreateTextureFromFile().
Anyhow, file access is slow. So, that will probably the main reason of the slowness, even if you could remove all the 'smart things' (and I don't there are a lot). And as I said before, you cannot load this same file 150 times in memory, especially if the image is big. It's totally inneficient and you will consume a lot of memory for nothing.
Are you developing a game ? In all games, a resource manager for this kind of stuff is required.
|
|
|
|
|
I do develop a game and your advice is totally currect, and will be implemented, by me I guess...
I'll just make that loading work only once and during times that the user won't notice.
Although it's a lot of files, these are relatively light-weight images, and only the loading time takes some CPU time effort.
It just happened that one of us raised that question (raised doubt on the specific function call), to make things as efficient as possible.
Thank you very much, and I wish I could help back sometime...
|
|
|
|
|
Same think I don't use directX, but reading the Documentation[^] :
For the best performance when using D3DXCreateTextureFromFile:
1. Doing image scaling and format conversion at load time can be slow. Store images in the format and resolution they will be used. If the target hardware requires power of two dimensions, create and store images using power of two dimensions.
2. Consider using DirectDraw surface (DDS) files. Because DDS files can be used to represent any Direct3D 9 texture format, they are very easy for D3DX to read. Also, they can store mipmaps, so any mipmap-generation algorithms can be used to author the images.
|
|
|
|
|
Thank you.
That stuff might speed things up but require me some work to test if it really worth the effort.
|
|
|
|
|
Hello board,is there a function to convert for example "0xFF" or "0F" to their corresponding int 255,16 ? I couldn't find a function like atoi so how should I do that?
thanks.
|
|
|
|
|
Have you considered strtol() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks a lot david, you solved the problem.
|
|
|
|
|
strtol [^] function, called with base=16 , does the magic, for instance:
char * szHex = "0F";
char * szStop;
int i;
i = strtol(szHex, &szStop, 16);
printf("%s hex = %d dec\n", szHex, i);
Please note the output of the program:
0F hex = 15 dec
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.
[my articles]
|
|
|
|
|
|
Hi all,
could somebody help me with following i need to call an external exe i.e of IDL in my MFC project it should work as in at end of my acquisation code i should be able to call this analysis exe of IDL and also for info IDL saves exe in *.sav format.
any help is greatly appreciated.
Thank you
Dipen
|
|
|
|
|
sunny.rana wrote: could somebody help me with following i need to call an external exe i.e of IDL in my MFC project it should work as in at end of my acquisation code i should be able to call this analysis exe of IDL and also for info IDL saves exe in *.sav format.
any help is greatly appreciated.
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.
[my articles]
|
|
|
|
|
I'm really not at all sure what you're asking but if you need to call an external executable have a look at the documentation for ShellExecute. This link[^] might help.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
sunny.rana wrote: ...i need to call an external exe
Do you need this?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
While we're guessing at what you're asking (acquisition code ) - I'm going to guess you mean during the build process. I which case, there are boxes for things to do pre- and post-build in the project properties.
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
hey i am new to VS 2008 and i was trying a simple pointer prgogram and to my dismay i couldnt build it,
#include <stdio.h>
int *pPointer;
void SomeFunction()
{
pPointer = new int;
*pPointer = 25;
}
void main()
{
SomeFunction();
printf("Value of *pPointer: %d\n", *pPointer);
}
the error i got was as follows:
------ Build started: Project: Testin, Configuration: Debug Win32 ------
Embedding manifest...
mt.exe : general error c10100b1: Failed to load file "..\Debug\Testin.exe". The system cannot find the path specified.
Build log was saved at "file://c:\Documents and Settings\Ravi\My Documents\Visual Studio 2008\Projects\Testin\Testin\Debug\BuildLog.htm"
Testin - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== </stdio.h>
i tried the google way and ended up here:<a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=109735&wa=wsignin1.0">https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=109735&wa=wsignin1.0</a>[<a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=109735&wa=wsignin1.0" target="_blank" title="New Window">^</a>]
which says they are looking over the matter so i am stuck with no clue ...
Thanks in Advance!
modified on Wednesday, February 06, 2008 12:03:16 PM
<div class="ForumMod">modified on Wednesday, February 06, 2008 12:07:23 PM</div>
|
|
|
|
|
1/ read the posting guidelines - it tells you about using the PRE tabs so we can see all your code - some of it is missing now, and it *might* be important.
2/ Try a full rebuild?
3/ Have a look through the project settings - maybe you should change a "..\Debug" to a "Debug" somewhere.
Good luck,
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
At a guess I'd say you've got invalid default project setting for the kind of project ( old standard C style Console App ) that you're trying to create.
First up check whether the compiler actually managed to build your exe, does the Debug build of Testin.exe actually exist anywhere. Then check if it runs outside VS 2008, ie double click on it and see if VS2008 built a bad exe. If all this works fine then it's just the Debugging settings of your project that aren't right, the IDE is looking for it in the wrong place I reckon.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I want to use windows InternetOpen() function call. In the documentation it is mentioned as it can be used in "OS Versions: Windows CE 2.0 and later". But i came to know after some search as, it possible to use this function call in windows XP. I have included "Wininet.h" header file also to use this function call. when i compile the program it throws error as "error LNK2001: unresolved external symbol __imp__InternetOpenW@20". Help me to get rid of this issue.
- vp
|
|
|
|
|
You probably forgot to link to "Wininet.lib" as it is stated in the documentation[^].
|
|
|
|