|
The logical way to find this would be to use the windows find facility and look for the definition of one of these functions, that's assuming that the MSDN docs don't tell you. I presume that they do and that's why you know the name. If you can't find it ( perhaps by using that handy windows file find function again ), then there's a good chance it's in an SDK you need to download.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi
I need some help with dialogbars.
I have an app that has a lot of dialogbars. I want to change style of some of the buttons in a dialogbar to have an arrow and a to show a drop down menu when clicked (like the IE back and forward button, or like the MS Word buttons.)
I did some digging around and found code and examples related to CToolBar where the toolbar style is set to TBSTYLE_EX_DRAWDDARROWS and the button style is set to TBSTYLE_DROPDOWN. I could not find appropriate methods to set these styles for a CDialogBar class. Can someone help me to get my buttons to have a dropdown menu just like CToolBar?
Thanks in advance. Any help appreciated.
|
|
|
|
|
There is no method for setting these styles for a CDialogBar class, the styles apply to CToolBarCtrl derived classes only. To recreate the look of the buttons on a CDialogBar you will probably need to custom draw the buttons youself (or try looking at the "Button Controls" section of CP).
Your best hope would prabably be the article "Professional User Interface Suite", buried in there some where is probably code for doing what you want.
Good Luck!
INTP
|
|
|
|
|
Hello,
I was looking for a clean 3DES implementation that uses ECB mode. Does anyone have a recommendation?
I want a PRNG. I typically use Crypto++, but Wei uses a variant of ANSI 9.17 that adds increased security against seed compromise attacks (encrypting the timestamps in CBC mode, instead of in ECB mode as is done in the standard X9.17 generator).
TIA,
Jeff
jeffrey.walton @ ssa.gov
|
|
|
|
|
google it
Don't try it, just do it!
|
|
|
|
|
I am trying to access the Microsoft SDK help files. I've have already registerd the SDK and have created programs that use it. Now either I can not remember how to access the help files in "\help" or I never could. All these .hxt, .hxq, and etc... files mean nothing if I can not access them.
What am I missing here?
Searching the www has not helped at all (yet).
Thanks for any help you can give me.
INTP
|
|
|
|
|
Start -->
All Programs -->
Microsoft Platform SDK <release date> -->
Platform SDK Documentation
|
|
|
|
|
Thanks for the quick reply!
Some times I wonder where I left my brain.
INTP
|
|
|
|
|
John R. Shaw wrote:
Some times I wonder where I left my brain
If you find yours, and mine is hanging around, would you send it home?
It's dinner time.
Software Zen: delete this;
|
|
|
|
|
how to add a number to a string?
can i convert from a string to double and reverse?
e.g
CString (or string) text = "37";
i want to add 4e3 to this value??!!!!!!!
|
|
|
|
|
Lookup the "Data Conversion" functions in the MSDN library (atof).
Basicaly you convert the string to a number add the new value to the old and then use CString::Format() function to replace the string with the new value.
double old = atof(&string);
old += new;
string.Format(_T("%f"),old);
or something simular.
INTP
|
|
|
|
|
Hi, I create this function to convert from double to CString.
var is the number to be converted
ndec Number of digits after decimal point
CString do2CStr(double var,int ndec)<br />
{<br />
int decimal, sign;<br />
char *buffer;<br />
buffer = _fcvt( var, ndec ,&decimal, &sign );<br />
int len=strlen(buffer);<br />
CString number(buffer); <br />
CString valor;<br />
if(sign)
valor="-"+number.Left(decimal)+"."+number.Right(len-decimal);<br />
else<br />
valor=number.Left(decimal)+"."+number.Right(len-decimal);<br />
return valor;<br />
<br />
}
Daniel Cespedes
"There are 10 types of people, those who understand binary and those who do not"
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|
|
Why, doesn't CString::Format work for you ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
I've added a crystal report object to my VC .Net project, but I can't figure out how to display it. Any help? I looked on the msdn and it tells you that it adds the classes for you in C# and VB.Net, but that you have to create them yourself in VC .Net - does anyone have any tips
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I would like to distinguish the editions of windows 2000 in my network.
So far I could not find a way of doing this. It seems there is no function to get the edition of a host in win32 api. NetServerGetinfo in only returning major and minor versions of the remote computer.
How can I get the suite,edition (e.g. win 200 professional, win 200 server etc.)
Orcun Colak
|
|
|
|
|
|
Hi,
I am declaring a std::vector<double> vX. I am filling it up using vX.push_back(aNum).
The problem is i want to put the contents of vX into DP which is defined as
double DP[];
This is because an external routine requires an array that is of the form above.
Any ideas would be appreciated.
Thanks
Kash
|
|
|
|
|
Hi Kash,
IIRC, vector is guaranteed to be continuous (its the only container with the guarantee). So you should be able to return the address of element 0 - &vX[0].
Is vX declared as follows?
std::vector<double> vX;
Please correct me if I am wrong.
Jeff
|
|
|
|
|
I'm new to .Net and am going through a chapter in a book I just bought with an example of an e-mail validation string using a regular expression. The string doesn't work! Does anyone have a proper regex for validating e-mails?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
bdiamond wrote:
The string doesn't work!
Meaning what? It allows an invalid address to pass, or it fails on a valid address?
Here are some examples of e-mail expressions:
http://www.breakingpar.com/bkp/home.nsf/Doc?OpenNavigator&U=87256B280015193F87256C40004CC8C6
http://www.regular-expressions.info/
http://www.codetoad.com/asp_email_reg_exp.asp
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
it allows an invalid e-mail address to pass.
here's the function:
bool CdotnetDlg::ValidEmail(CString strMail)
{
#pragma push_macro("new")
#undef new
CString strPattern = "[\\w]+@[\\w]+.[\\w]{2,3}";
Match* pMatch =Regex::Match(strMail,strPattern);
#pragma pop_macro("new")
return pMatch->Success;
}
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Hey all, I have a .h and .lib for an API I would like to use. The only problem is, I need to use it from managed code, therefore, I need to turn it into a dll so I can use DllImport to import the functions. The API was written in C++. What is a quick and easy way to compile this into a dll that I can use?
|
|
|
|
|
what do u mean by "written in C++"?
give an example of a function you want to export.
Don't try it, just do it!
|
|
|
|
|
I want to draw a transparent sprite onto a HDC / HBITMAP from an array.
This is a simplified version of what I have.
Basically I want to draw a sprite (Helicopter) that moves around the screen.
But I can't seem to draw the helicopter without a black block surrounding it.
This is my example sprite - It should draw a diagonal blue and green line.
int yVals[4] = {0, 1, 2, 3};
int xVals[4] = {0, 1, 2, 3};
int colourVals[4] = {0x0000FF00, 0x0000FF00, 0x000000FF, 0x000000FF};
My device handles are:
HDC hSpriteDC;
HDC hMemDC;
HDC hMaskDC;
and a couple others for the background
HBITMAP hSpriteBitmap;
HBITMAP hMemBitmap;
HBITMAP hMaskBitmap;
I call this proc on start up. It creates the HDC's and HBITMAPS. It also draws only the
points that I want to see. I was hoping that it would leave the rest of the "drawing area" transparent. But it didn't.
void initHDC(HDC hDC)
{
hMaskDC = CreateCompatibleDC(hDC);
hMaskBitmap = CreateBitmap(4, 4, 1, 1, NULL);
hSpriteDC = CreateCompatibleDC(hDC);
hSpriteBitmap = CreateCompatibleBitmap(hDC, 4, 4);
hMemDC = CreateCompatibleDC(hDC);
hMemBitmap = CreateCompatibleBitmap(hDC, 4, 4);
SelectObject(hSpriteDC, hSpriteBitmap);
SelectObject(hMemDC, hMemBitmap);
SelectObject(hMaskDC, hMaskBitmap);
int i;
for(i = 0; i < 4; i++)
{
SetPixel(hSpriteDC, xVals[i], yVals[i], COLORREF(colourVals[i]));
SetPixel(hMaskDC, xVals[i], yVals[i], COLORREF(0x00FFFFFF));
}
}
I've also tried inserting
SetBkMode(hSpriteDC, TRANSPARENT)
into my code after the SelectObjects.
I call this Procedure from my OnPaint procedure:
I've tried all sorts of raster operations.
void drawSprite(int x, int y, int dx, int dy)
{
BitBlt(hMemDC, x - 40, y - 40, x + 40, y + 40, hHeliDDC, 0, 0, SRCCOPY);
//I also tried this:
//BitBlt(hMemDC, x - 40, y - 40, x + 40, y + 40, hSpriteDC, 0, 0, SRCCOPY);
//BitBlt(hMemDC, x - 40, y - 40, x + 40, y + 40, hMaskDC, 0, 0, SRCAND);
}
In my OnPaint() procedure, I have:
PAINTSTRUCT ps;
RECT r;
r.top = 0;
r.bottom = 500;
r.left = 0;
r.right = 800;
ps.rcPaint = r;
BeginPaint( hwnd, &ps );
//Draw BackGround
//My background is stored in hBackDC
BitBlt( hMemDC,
ps.rcPaint.left,
ps.rcPaint.top,
ps.rcPaint.right,
ps.rcPaint.bottom,
hBackDC,ps.rcPaint.left,
ps.rcPaint.top,
SRCCOPY );
drawSprite(x, y, dx, dy);
BitBlt(ps.hdc,
ps.rcPaint.left,
ps.rcPaint.top,
ps.rcPaint.right,
ps.rcPaint.bottom,
hMemDC,
ps.rcPaint.left,
ps.rcPaint.top,
SRCCOPY );
EndPaint( hwnd, &ps );
I have tried Seting the pixels in my OnPaint() procedure, but thats too slow.
I hope I've made my problem clear.
Please - any suggestions would be awesome.
|
|
|
|
|