|
|
Hello there,
I believe that AfxGetResourceHandle() is simply returning the allocation base of the module which contains the resource your attempting to access. This is so it can correctly calculate PE image offsets. Therefore you should be able to simply do the following:
If the resource is located inside the module your executing code from you can do this:
#define MyGetResourceHandle ((HINSTANCE)&__ImageBase)
HICON hIco1 = (HICON) LoadImage(MyGetResourceHandle,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,16,16,0);
Best Wishes,
-David Delaune
|
|
|
|
|
I've a class which has a member of Gdiplus::Bitmap * ,
any way to serialize a Gdiplus::Bitmap object?
Thanks.
|
|
|
|
|
What about save the Bitmap to stream (Image::Save)[^], where the stream resides in memory (CreateStreamOnHGlobal)[^] and then writting the stream to file CArchive::Write. Reverse the process for loading object CArchive::Read, CreateStreamOnHGlobal, Bitmap::FromStream. overload << >> on CArchive for insertion and extraction.
|
|
|
|
|
|
Hi everyone,
i am doing concatination in my activeX control project.means i am having two varibles one is MemId is of type LPCTSTR and another one is strmsg is of type char *strmsg.this is in read block function.
i am doing like this:
MemId=dStr;
strmsg=strcat(strmsg,MemId);
MessageBox(strmsg);
it is not giving error but when i execute my actual program in that i used this activeX control. that time is giving send error or dont send error message box.
afterwords i changed this to for first time i used string copy function but it is also giving same error.
Please Help Me what's wrong with my code.
**********THANKS IN ADVANCE*********
Savitri
|
|
|
|
|
Have you allocated strmsg?
possibly you are not allocating char *strmsg; you need to allocate memory for the string. something like char strmsg[YOUR_STRING_SIZE]; char *strmsg = new char[YOUR_STRING_SIZE];
savitri wrote: strmsg=strcat(strmsg,MemId);
It seems your module is not unicode as strcat doesnot give error at compilation taking (char *, LPCTSTR).
And as a side note, IMHO, when you are using generic string data type LPCTSTR always use generic text manipulation API's and data structure, use _tcscat inplace of strcat.
Unicode, MBCS and Generic text mappings[^]
generic text apis start with _tcsxxx search in msdn index when you want a mapping to string functions with strxxx
modified on Tuesday, March 25, 2008 6:46 AM
|
|
|
|
|
It's spelled "CONCATENATION"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Hi
I m working in vs 2005 using Win Mob 5.0 Smart Phone SDK using Win32 APIs. When i m trying to add icons in a ImageList by using ImageList_AddIcon macro it gives error 'ImageList_AddIcon': identifier not found. While all other macros are working fine. Also i have tryed with ImageList_ReplaceIcon but same error.
Thanks in Advance
|
|
|
|
|
|
Thanks for your suggestion but still not working.
|
|
|
|
|
Try DRA::ImageList_AddIcon
|
|
|
|
|
#include <stdio.h>
#include <malloc.h>
int min(int a, int b, int c)
{
int temp=a<=b?a:b;
return temp<=c?temp:c;
}
int MinOperation(int len1, char str1[], int len2, char str2[])
{
int count[10001][10001];
int i,j;
for(i=0; i<1001; i++)
count[0][i]=0;
for(i=0; i<1001; i++)
count[i][0]=0;
for(i=1; i<=len1; i++)
for(j=1; j<=len2; j++)
{
if(str1[i]==str2[j])
count[i][j]=min( count[i-1][j-1], count[i-1][j]+1, count[i][j-1]+1);
else
count[i][j]=min( count[i-1][j-1]+1, count[i][j-1]+1, count[i-1][j]+1 );
}
return count[len1][len2];
}
void main()
{
int i=0;
int len1;
int len2;
char str1[1001];
char str2[1001];
scanf("%d%s", len1, (str1) );
scanf("%d%s", len2, (str2) );
puts(str1);
puts(str2);
printf("%d", MinOperation(len1 ,str1 ,len2 ,str2));
}
I am not sure why there exist a bug stack overflow?
|
|
|
|
|
wendyyue wrote: scanf("%d%s", &len1, (str1) );
scanf("%d%s", &len2, (str2) );
if you specified parameters for scanf correctly, the above, then the stack overflow is due to the stack allocation int count[10001][10001]; which is "10001 * 10001 * sizeof (int)" which is very large than the default stack size which is 1MB. To increase the stack size /STACK (Stack Allocations)[^].
It is better to allocate in heap.
And also array size in main 1001 and size in MinOperation 10001 check it for logic of your program (Any way int count[1001][1001] is also going to issue stack overflow).
|
|
|
|
|
Hi all,
I am new to this group.I am developing an IDE for my project.
I want to know whether i can create dockable windows using MFC only.
I dont want to use WTL classes in my project.
I am working on Visual Studio 2005 environment.
Can any one help me with the source code for creating a dockable
windows with MFC only?
Regards
Suhas
|
|
|
|
|
|
hi 2 ALL
What is the difference between unicode code character set and multibyte character set in visual C++?
*****THANKS N ADVANCE****
Mathen.K
(I WILL TRY MY LEVEL BEST )
|
|
|
|
|
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Once we figured out that taking our shoes and socks off would double our counting ability the technical glitch was quickly rectified. -- Chris Maunder, from the CP newsletter
|
|
|
|
|
|
Hi,
I am trying to compile the custom created MFC Activex control for my Applciation, I am getting following Errors:
Plz help me how to overcome this..
error LNK2005: ___CppXcptFilter already defined in msvcrtd.lib(MSVCR71D.dll)
warning LNK4006: ___xc_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
warning LNK4006: ___xc_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
warning LNK4006: ___xi_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
warning LNK4006: ___xi_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
warning LNK4006: ___CppXcptFilter already defined in msvcrtd.lib(MSVCR71D.dll); second definition ignored
warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
With reg,
Subbu
|
|
|
|
|
You might want to check the LIB files you are linking to. One of the ways that this can happen is if you link to a static library which was in turn built statically linked to a CRT. So now, you've got 2 copies of the CRT that you are linking against - causing the multiple definition errors.
If the other library you are linking to is under your control (i.e. you have the source and can build it), then see if you can get it to link dynamically to the CRT as well. If it isn't, well, then its a bit tricky. You might have to tinker with the /NODEFAULTLIB option and try to use the CRT that comes with the 3rd party LIB.
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Once we figured out that taking our shoes and socks off would double our counting ability the technical glitch was quickly rectified. -- Chris Maunder, from the CP newsletter
|
|
|
|
|
spalanivel wrote: Plz help me how to overcome this..
You can start with these:
LNK2005
LNK4006
LNK4098
"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
|
|
|
|
|
I use evc++ extensively, which is sufficiently close to VC 6.0 that I think I am safe asking this question. I have a relatively large project - 600+ files - and I've started having to rebuild all files when I change targets. For some reason the ide / nmake decides I've changed something very important. Any ideas as to tracking down what file is triggering this?
chg
Charlie Gilley
Will program for food...
|
|
|
|
|
I also use EVC 3.0 and 4.0 with similar sized projects. Unfortunately what you're experiencing is normal as far as I can tell. When you change targets you're changing SDKs, derived from the different builds of CE with different BSPs. Any headers from the CE build used in your project, and there's almost bound to be some, will therefore change and if they're globalish headers everything will want rebuilding. You may be able to mitigate this a little by carefully trimming your #include inclusions but a full rebuild is still going to be needed in a lot of cases. Add to thi the known issues with the mostly failed attempt at an incremental linker that comes with EVC4/MSVC6 and you're probably better off wiht a full rebuild anyway. Good luck
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I'm at 4.1 and 5.0. Although I understand what you are saying, the target files are split according to SDK/target, and this *was* working in the past. It's just recently the thing has become possessed and insistent on rebuilding every dang file. It tasks me.
I'll keep looking, I know I'm going to have to go into the command line and run nmake manually to see what is going on. If I learn anything useful, I'll post it back here.
Charlie Gilley
Will program for food...
|
|
|
|