|
Friends, I use Visual Studio (2008) and created a project (MFC Doc-View application). I have to use some third party libraries (which has DLLs etc). How to use 'using' to make the program alright? I request a reliable reply.
If 'using' cannot be made use of in MFC, may I know how to invoke the DLLs.
My e-mail is rajeswarit@rediffmail.com
With many thanks,
Rajeswari
|
|
|
|
|
|
A quick off-topic remark: I suggest to edit your posting to at least insert blanks in your email address, replace '@' with '(at)' or similar means to confound spam bots that frequent public forums in search of email addresses. Doing so might safe you from unwanted spam. Even better, don't post your E-Mail address at all, at least not in places that can be read with public access.
Regarding your question, invoking a DLL has nothing to do at all with 'using' (at least in C/C++). Referring classes and functions from another DLL can be achieved by different means, but the easiest is to add the header files of that DLL to your project, #include them, and add the export libraries (*.lib) to your linker 'additional libraries' (or similar) options. Follow the links in the response above for more help.
|
|
|
|
|
Hi,
I have a file that is replacing embedded blanks with x0d 0a and starting text again is there anyway to read the text as I CRead::Read(file,121) and I am expecting text in certain columns
Thanks
|
|
|
|
|
ForNow wrote: I have a file that is replacing embedded blanks with x0d 0a...
I'm with you so far.
ForNow wrote: ...and starting text again
Things start getting unclear at this point.
ForNow wrote: is there anyway to read the text as I CRead::Read(file,121)...
Not sure what this means.
ForNow wrote: ...and I am expecting text in certain columns
Ok. Does this have any relevance to your other text?
Please be clear with your question(s). Run-on sentences make it hard to decipher.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
e.g. This how the file appears when open it under note pad
Options for this Assembly
0 NOADATA
ALIGN
ASA
BATCH
CODEPAGE(047C)
NOCOMPAT
NODBCS
NODECK
DXREF
ESD
NOEXIT
NOPCONTROL
NOPESTOP
here is how the file looks in memory using CFILE::READ(pbuf,121)
0x001AA3C8 54 0d 0a 20 20 20 20 20 4f 50 54 41 42 4c 45 28 55 4e 49 2c 4e 4f 4c 49 53 54 29 0d 0a 20 20 20 4e 4f 50 43 4f 4e 54 52 4f 4c 0d 0a 20 20 20 4e 4f 50 45 53 54 4f 50 0d 0a 20 T.. OPTABLE(UNI,NOLIST).. NOPCONTROL.. NOPESTOP..
0x001AA402 20 20 4e 4f 50 52 4f 46 49 4c 45 0d 0a 20 20 20 4e 4f 52 41 32 0d 0a 20 20 20 4e 4f 52 45 4e 54 0d 0a 20 20 20 20 20 52 4c 44 0d 0a 20 20 20 20 20 52 58 52 45 46 0d 0a 20 20 NOPROFILE.. NORA2.. NORENT.. RLD.. RXREF..
for example the are at least over 100 blanks "0x20" between NOPCONTROL and NOPSTOP They are being truncated discregarded After the text NOPCONTROL all blanks following are being disregarded and replaced by carriage reuturn X0D and line feed 0x0A
|
|
|
|
|
Notepad is showing NOPESTOP in the next line after NOPCONTROL.
This means that there is a 0x0D/0x0A pair after NOPCONTROL.
You can verify this by turning off word wrapping (Format -> Word Wrap).
If the test still displays as it is now after turning off word wrap, you can be sure that there is a 0x0D/0x0A pair after NOPCONTROL.
|
|
|
|
|
Is there any way to do one CFILE::PREAD for every 0xoA/0x0d
Thanks
|
|
|
|
|
|
I have C++ application in which so many STL data structures used. I am storing my own class objects in the STL data structures. For example some are std::map<wchar_t*,wchar_t*>, std::map<int,myclass*>, etc...
I would like to serialize the data structure with out using MFC's CArchive. I tried to use wfstream and it is not working for unicode strings.
is there any easy way to achieve this?
thanks in advance
- Mutpan.
|
|
|
|
|
If you post some code of what is not working, we could suggest something to make it work.
|
|
|
|
|
Unfortunately, wfstream can handle Unicode characters and strings passed into the stream but will only produce Ansi output. You need to use the old C-style Stream I/O[^], the stream::write()[^] function to write raw data, or use the CArchive if you have MFC in your project.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
<big><b>
Hy Guys
</b></big>
<pre lang="text">
I wants to maintain previous location of blob.
I have coordinates struct some thing like this
</pre>
<pre lang="c++">
struct coordinate
{
unsigned int x;
unsigned int y;
unsigned int prevX;
unsigned int prevY;
void * data;
};
</pre>
<pre lang="text">
and blob struct like this ,.
</pre>
<pre lang="c++">
struct blob
{
//unsigned int blobId;
coordinate min, max;
coordinate center;
};
</pre>
<pre lang="text">
inside loop for video
</pre>
<pre lang="c++">
// Calculate center
for(map<unsigned int, blob>::iterator i = blobs.begin(); i != blobs.end(); ++i)
{
(*i).second.center.prevX = (*i).second.center.x;
(*i).second.center.prevY = (*i).second.center.y;
(*i).second.center.x = (*i).second.min.x + ((*i).second.max.x - (*i).second.min.x) / 2;
(*i).second.center.y = (*i).second.min.y + ((*i).second.max.y - (*i).second.min.y) / 2;
}
</pre>
<pre lang="text">
But problem is my previous location of blobs always appeared 0 .
you can see in this image attached image :
What am i doing mistake , could any one please help me
</pre>
|
|
|
|
|
Please stop reposting the same thing. Edit this question (use the "Edit" link in the above message) and fix the formatting; use the Preview button to check before posting.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
ok but sir . there is not any preview button.
I am stuck in my problem .
I need to solve it today only .
|
|
|
|
|
My apologies, but you do not need a button as the preview is generated automatically. You can also view your question after it is posted to see that it is correct.
For example, this line is simple text and does not need any tags around it.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Richard MacCutchan wrote: My apologies, but you do not need a button as the preview is generated
automatically.
Presumably you mean *IF* there is no preview button.
Because this very post is not automatically creating a preview. There is however a preview button.
The other browser I use does create a preview automatically.
|
|
|
|
|
Well, I was responding to the OP, who specifically said that there is no preview button.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
love bird wrote: I need to solve it today only .
To put it bluntly... that's your problem not ours. Sorry
Next time, do your homework ahead of time. We're here to help but we all do this for free on our own time, so your time frames are nobody else's problems but your own.
|
|
|
|
|
|
In reply to your message:
Can i send you my question in your email box using msn or gmail or yahoo from any service ?
Sorry, but (like most people here) I do this in my own time and at my own pace, I do not provide private consultancy.
If you have a question that you want help with then you are welcome to post it here, and people will help where they can and in their own time. If you need professional help then you need to find a local consultant or try one of the job sites.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
<pre lang="text"><b>Edited 1 more time :</b></pre>
<pre lang="text">I want to maintain previous location of blob .
so declare a struct of coordinates some thing like this .</pre>
<pre lang="c++">
struct coordinate
{
unsigned int x;
unsigned int y;
unsigned int prevX;
unsigned int prevY;
void * data;
};</pre>
and blob struct is like
<pre lang="c++">struct blob
{
//unsigned int blobId;
coordinate min, max;
coordinate center;
};
</pre>
<pre lang="text">and i used map to maintain each blob as an id . and its location as value of id/.
I calculated each blob previous location some thing like this </pre>
<pre lang="c++">// Calculate center
for(map<unsigned int, blob>::iterator i = blobs.begin(); i != blobs.end(); ++i)
{
(*i).second.center.x = (*i).second.min.x + ((*i).second.max.x - (*i).second.min.x) / 2;
(*i).second.center.y = (*i).second.min.y + ((*i).second.max.y - (*i).second.min.y) / 2;
(*i).second.center.prevX = (*i).second.center.x;
(*i).second.center.prevY = (*i).second.center.y;
}
</pre>
<pre lang="text">
this image link : http://imageshack.us/photo/my-images/192/mainprevposagaingeachbl.png/</pre>
<pre lang="text">Previous location seems like not correct .
If first time current X = 2 and current Y = 5 then previous X and previous Y should be 0
then if an object take one more step then if an object have current X = 10 and current Y = 44
then previous X should have 2 and previous Y should have 5 .
what's wrong ?
Can some one please help me .thanks</pre>
<big><b>New Updated Code :</b></big>
<b>Hy Guys ,</b>
<pre lang="text">I wants to maintain previous location of blob.
I have coordinates struct some thing like this
</pre>
<pre lang="c++">struct coordinate
{
unsigned int x;
unsigned int y;
unsigned int prevX;
unsigned int prevY;
void * data;
};</pre>
<pre lang="text">and blob struct like this ,. </pre>
<pre lang="c++">struct blob
{
//unsigned int blobId;
coordinate min, max;
coordinate center;
};
</pre>
<pre lang="text">inside loop for video</pre>
<pre lang="c++">// Calculate center
for(map<unsigned int, blob>::iterator i = blobs.begin(); i != blobs.end(); ++i)
{
(*i).second.center.prevX = (*i).second.center.x;
(*i).second.center.prevY = (*i).second.center.y;
(*i).second.center.x = (*i).second.min.x + ((*i).second.max.x - (*i).second.min.x) / 2;
(*i).second.center.y = (*i).second.min.y + ((*i).second.max.y - (*i).second.min.y) / 2;
}</pre>
<pre lang="text">But problem is my previous location of blobs always appeared 0 .
you can see in this image attached image :
What am i doing mistake , could any one please help me .</pre>
-- modified 19-Jan-12 9:04am.
|
|
|
|
|
Could you please properly use the code button to format your code and correctly set your links?
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]
|
|
|
|
|
<pre lang="text">Edited and may be good enough to understand Code :</pre>
<pre lang="text">I want to maintain previous location of blob .
so declare a struct of coordinates some thing like this .</pre>
<pre lang="c++">
struct coordinate
{
unsigned int x;
unsigned int y;
unsigned int prevX;
unsigned int prevY;
void * data;
};</pre>
and blob struct is like
<pre lang="c++">struct blob
{
//unsigned int blobId;
coordinate min, max;
coordinate center;
};
</pre>
<pre lang="text">and i used map to maintain each blob as an id . and its location as value of id/.
I calculated each blob previous location some thing like this </pre>
<pre lang="c++">// Calculate center
for(map<unsigned int, blob>::iterator i = blobs.begin(); i != blobs.end(); ++i)
{
(*i).second.center.x = (*i).second.min.x + ((*i).second.max.x - (*i).second.min.x) / 2;
(*i).second.center.y = (*i).second.min.y + ((*i).second.max.y - (*i).second.min.y) / 2;
(*i).second.center.prevX = (*i).second.center.x;
(*i).second.center.prevY = (*i).second.center.y;
}
</pre>
<pre lang="text">
this image link : http://imageshack.us/photo/my-images/192/mainprevposagaingeachbl.png/</pre>
<pre lang="text">Previous location seems like not correct .
If first time current X = 2 and current Y = 5 then previous X and previous Y should be 0
then if an object take one more step then if an object have current X = 10 and current Y = 44
then previous X should have 2 and previous Y should have 5 .
what's wrong ?
Can some one please help me .thanks</pre>
|
|
|
|
|
Please uncheck the 'Treat my content as plain text, not as HTML' checkbox.
BTW I cannot see the issue with just the above 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]
|
|
|
|