|
Many Thanks for trying to help. But I'm still having problems.
I have set my General->Microsoft Foundataion Classes option to "use shared dll" and also set use of runtime libary to multithreaded dll. I still get this error. Please help.
Linking...
monTest4.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class CString __thiscall CDMsgException::GetMsg(int)const " (__imp_?GetMsg@CDMsgException@@QBE?AVCString@@H@Z)
Release/monTest4.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
monTest4.exe - 2 error(s), 0 warning(s)
|
|
|
|
|
Here is my problem:
I need a way to encode X and Y (can be negative numbers and equals) to return me a N integer number always diferent.
(x=2,y=2) = N
(x=-2,y=2) = different N
(x=0,y=0) = another different N
Understand me? Anyone can help me? Thanks in advanced!
|
|
|
|
|
can any two pairs of X and Y ever give the same N ?
ex.: X1, Y1 = N1 and X2, Y2 = N1 ?
if not, my first guess is that you can't do it, using 32 bit integers for X,Y and N. you need 64 bits to represent 32x2 bits of input data if you can't have collisions.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
No N should never be the same, that's the main propose :\
My hope is that we can do it only with 'some math'!
|
|
|
|
|
Do you want to generate a unique value called N?
-prakash
|
|
|
|
|
No, any X and Y should give a unique N
(X=2,Y=2) should return always the same N
(X=1,Y=3) should always return any other N
N can be any integer
|
|
|
|
|
But there are much more (X,Y) pairs than Ns, so every pair can't have unique N.
|
|
|
|
|
Problem is:
1. I have to, in some way, save points (x,y) to a skiplist
2. I've to search for that point in that skiplist and return true if is in it otherwise false.
3. But how can I search for a point that is not a single integer? How can I compare if it's higher or lower to go to next node?
|
|
|
|
|
Mal-Functi wrote: But how can I search for a point that is not a single integer? How can I compare if it's higher or lower to go to next node?
have you tried:
if X1 > X2 then
if Y1 > Y2 then
P1 is > P2
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hello,
You can try the following:
std::pair<int, int> PointPair(x,y);
if( PointPair > PPn )
{ }
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
what about MAKELONG MACRO
DWORD dwEncodeVal=MAKELONG(x,y);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
int the function OnDraw();I want to create a DIB bitmap using the array pData,and display it on the screen,but I am not fail to do it;Would please tell me how to correct the codes below.
//the array containing color information
unsigned char* pData=new unsigned char[768*576*3];
int y=0, x=0;
for(;y<576;y++)
for(;x<768;x++)
{
pData[x*3+y*768*3]=0;
pData[x*3+1+y*768*3]=0;
pData[x*3+2+y*768*3]=255;
}
//information header
BITMAPINFOHEADER FrameBmi;
FrameBmi.biSize=sizeof(BITMAPINFOHEADER);
FrameBmi.biPlanes=1;
FrameBmi.biCompression=BI_RGB;
FrameBmi.biClrImportant=0;
FrameBmi.biSizeImage=768*576*3;
FrameBmi.biClrUsed=0;
FrameBmi.biBitCount=24;
FrameBmi.biWidth=768;
FrameBmi.biHeight=576;
FrameBmi.biXPelsPerMeter = 0;
FrameBmi.biYPelsPerMeter =0;
//file header
BITMAPFILEHEADER pf;
pf.bfType=0x4d42; //"BM"
pf.bfSize=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+sizeof(char[768*576]);
pf.bfOffBits=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
pf.bfReserved1=0;
pf.bfReserved2=0;
//BITMAPINFOHEADER
LPBITMAPINFO lpbmi=(LPBITMAPINFO)GlobalAlloc(GMEM_FIXED,sizeof(BITMAPINFOHEADER));
ASSERT(lpbmi);
lpbmi->bmiHeader.biSize=FrameBmi.biSize;
lpbmi->bmiHeader.biPlanes=FrameBmi.biPlanes;
lpbmi->bmiHeader.biCompression=FrameBmi.biCompression;
lpbmi->bmiHeader.biClrImportant=FrameBmi.biClrImportant;
lpbmi->bmiHeader.biSizeImage=FrameBmi.biSizeImage;
lpbmi->bmiHeader.biClrUsed=FrameBmi.biClrUsed;
lpbmi->bmiHeader.biBitCount=FrameBmi.biBitCount;
lpbmi->bmiHeader.biWidth=FrameBmi.biWidth;
lpbmi->bmiHeader.biHeight=FrameBmi.biHeight;
lpbmi->bmiHeader.biXPelsPerMeter=FrameBmi.biXPelsPerMeter;
lpbmi->bmiHeader.biYPelsPerMeter=FrameBmi.biYPelsPerMeter;
lpbmi->bmiColors=NULL;
//Create DIBitmap
CBitmap *OldBitmap;
HBITMAP bmp =::CreateDIBitmap((HDC)pDC,&FrameBmi,CBM_INIT,pData,lpbmi, DIB_RGB_COLORS);
ASSERT(bmp);
//
CBitmap bitmap;
bitmap.Attach(bmp);
CDC dcComp;
dcComp.CreateCompatibleDC(pDC);
OldBitmap=dcComp.SelectObject(&bitmap);
BITMAP bm;
bitmap.GetObject(sizeof(BITMAP),&bm);
// draw bitmap
pDC->BitBlt(0,0,768,576,&dcComp,0,0,SRCCOPY);
dcComp.SelectObject(OldBitmap);
delete [] pData;
GlobalFree(lpbmi);
delteDC(dcComp);
I LOVE VC
-- modified at 6:43 Sunday 16th October, 2005
|
|
|
|
|
|
I got a error that there was a ASSERT error in the line of "CreateDIBitmap()",
I am fail to create a DIB bitmap and display it in the monitor.
I LOVE VC
|
|
|
|
|
|
pData is too small for the bitmap you are trying to create.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
yes,the pData should be pData=new unsigned char[768*576*3],but after above update,I am fail to create the DIB bitmap again,
I LOVE VC
|
|
|
|
|
::CreateBitmap(pDC->m_hDC, ...
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
My code:
<br />
#include "stdafx.h"<br />
#include <windows.h><br />
<br />
<br />
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow);<br />
<br />
void main()<br />
{<br />
MessageBox(NULL , "Question 1", "Do you like World Of Warcraft?", NULL | MB_YESNOCANCEL);<br />
<br />
}<br />
How can you make it so if he clicks yes it prints "Good Choice" and if he clicks no it will open a ".com" file?
Any resposes will be very helpful.
Another passing being longing to enhance his intellect.
Gnaritas est potestas.
Knowledge is power.
|
|
|
|
|
int nResponse = MessageBox(NULL , "Question 1", "Do you like World Of Warcraft?", MB_YESNOCANCEL);
if (IDYES == nResponse)
MessageBox(NULL, "Response", "Good Choice", MB_OK);
else if (IDNO == nResponse)
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
MessageBox returns a value which indicates whether the user choose yes or no.
<br />
int nResult = MessageBox(...);<br />
<br />
if (nResult == IDYES)<br />
...<br />
<br />
else if (nResult == IDNO)<br />
...<br />
<br />
"When you know you're going to eat crow, it's best to eat it while it's still warm." - Reader's Digest
|
|
|
|
|
Thanks mate, I really appreciate it
Another passing being longing to enhance his intellect.
Gnaritas est potestas.
Knowledge is power.
|
|
|
|
|
if(IDOK==MessageBox(NULL , "Question 1", "Do you like World Of Warcraft?", NULL | MB_YESNOCANCEL))
then
{
add you code here
}
else
{
add you code here
}
I LOVE VC
|
|
|
|
|
Hi,
I want to delete a class from my project
(class view) butI am not sure that how to do it.
I looked through all file, edit menu.
I don't see any options to do so.
I tried to delete the cpp & h files but
I got compilation error, C1083:
Cannot open source file:.........
Can someone give me some suggestions?
Thanks,
Kevin
|
|
|
|
|
you should also delete the cpp&h files in the "FILEVIEW" of workspace view(which containing three view,Class view,resource views,fileview),delete the cpp file in the "Soure Files",and delete the h file int the "Header files".Following above steps, you will not get the compilatin error.
I LOVE VC
-- modified at 21:58 Saturday 15th October, 2005
|
|
|
|