|
You may be able to set a region. Otherwise you can use masking, just like any bitmap which is being drawn transparently with a colour key. I believe TransparentBlt works this way. You'll need W98 or later, and the Platform SDK.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
|
Thanks for the plug
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Use ::CreateRoundRectRgn to create a region with rounded corners. Then call ::SelectClipRgn with your DC that you are going to paint your bitmap onto. The clipping region will prevent your bitmap from painting outside of the rounded rectangle that you create.
Shog9 has listed some articles here on CP that will help you.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
I need change a Dos-C program with VC++6.0. In the Dos-C program, there is a piece of 16-bit masm code like the following:
-----------------------------------------------------------
_asm {
les bx, SRB
push es
push bx
lea bx, Aspi
call DWORD PTR [bx]
add sp, 4
}
where Aspi is defined as:
void (__far *Aspi)(u_char far *) = (void __far *)0;
srbExecIo *SRB;
typedef struct {
u_char commandCode;
u_char commandStatus;
u_char hostAdapterNo;
u_char scsiRequestFlag;
u_char reserved1[ 4 ];
u_char targetId;
u_char targetLun;
u_long dataAllocLength;
u_char senseAllocLength;
u_char *dataBuffer;
u_char *srbLink;
u_char scsiCdbLength;
u_char hostAdapterStatus;
u_char targetStatus;
u_char *postRoutine;
u_char reserved2[ 34 ];
union cdbAndSense ca;
} srbExecIo;
--------------------------------------------------------------------
I'm a newer for masm32. I used wnaspi32.dll for aspi-scsi management in new VC++ code.
Would please tell me how to change above code into VC++ code ? and some related setting information?
Thanks in advance!
chen
|
|
|
|
|
iam writing a simple win32 dll.if i want to return the string from dll, there is a warning that warning C4172: returning address of local variable or temporary
i want to know how to return the value correctly.can anyone answer
|
|
|
|
|
Even if you tell us what the warning sayas you HAVE to show us some code also!
It's impossible to help if you don't show us some code snippets!
Are you returning like:
...
return &myVaribleOrObject;
If yes:
Then I can tell that you can't return an address of a local varible from a function. Show me some code and I can help you!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
extern "C" LPTSTR _stdcall ReturnIEVersion()
{
HKEY hKey;
char szIEVersion[MAX_PATH];
DWORD dwType=REG_SZ, dwRetSize = MAX_PATH;
if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer",0, KEY_READ, &hKey))
{
DWORD dwType=REG_SZ, dwRetSize = MAX_PATH;
if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Version", NULL, &dwType, LPBYTE(szIEVersion), &dwRetSize))
{
return szIEVersion;
}
else
{
return "IEVersion not found";
}
RegCloseKey(hKey);
}
else
{
return "Open Key Failed";
}
|
|
|
|
|
Ok,
All three of szIEVersion, "IEVersion not found" and "Open Key Failed" are non-static local variables, i.e., they are declared at function scope. This means that they are not valid once the program runs out of their scope, i.e., the function returns. They are only valid inside the function.
My suggestion is that you instead pass the char array along with its max length as parameters to the function and return TRUE or FALSE if success or failure, and copy "IEVersion not found" and "Open Key Failed" where you call this function, based on the return value. Like this:
extern "C" BOOL _stdcall ReturnIEVersion(LPTSTR pszIEVersion, INT nMaxLen)
{
HKEY hKey;
DWORD dwType = REG_SZ;
DWORD dwSize = nMaxLen + 1;
LPCTSTR pszKey = _T("Software\\Microsoft\\Internet Explorer");
if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, pszKey, 0, KEY_READ, &hKey))
{
if(ERROR_SUCCESS == RegQueryValueEx(hKey, _T("Version"), NULL, &dwType, LPBYTE(pszIEVersion), &dwSize))
{
return TRUE;
}
else
{
return FALSE;
}
RegCloseKey(hKey);
}
else
{
return FALSE;
}
}
|
|
|
|
|
I have used VC++ 6.0 to developed a program. However, I found the EXE file can only run on a conputer with VC installed. However if no VC is installed on the computer, it will say "Cannot find ***.dll file", So currently what I did is to copy also the required DLL file from my PC to the target PC and place the DLL file into the same folder. It can work then...
However, I just feel it is not a neat way to solve the problem. Can anybody tell me some other better solution to build my program so as to make resultant EXE file work on PCs without VC installed also?
Thanks in Advance...
|
|
|
|
|
Yes, if you have a version higher than the standard one, you can choose to statically link to the MFC dll. Then you simply need to avoid the C run time, and you'll stand a good chance of being where you want to be, so long as you do not use Direct X, MDAC, GDI+, etc.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
|
If the program was compiled in Debug mode, it will require many VC debugging DLLs to run. If you compile the program in Release mode, it will not need those DLLs.
|
|
|
|
|
Hi,
I am using VC6.0++ with DAO & MS Access97! So far I use SQL successfully ... well except 1 thing:
I would like search a column (define as Boolean) in a databse table that has logic Checked (true?)
Whenever I did ... it does not worked!
1) strSQL.Format ("SELECT * FROM Sample WHERE Logic = 1");
2) strSQL.Format ("SELECT * FROM Sample WHERE Logic = TRUE");
3) strSQL.Format ("SELECT * FROM Sample WHERE Logic = %d", value); // set value = 1
*) Can anyone help me on this, I appreciate any help here
Many thanks,
Anh
|
|
|
|
|
Anonymous wrote:
Can anyone help me on this, I appreciate any help here
I just did something in Access XP and created a query that looks like this:
SELECT Table1.ID
FROM Table1
WHERE (((Table1.ID)=True));
There may be slight differences between 97 and XP in regards to the syntax, however I doubt this would be one of them. Hope this helps.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
Hi,
I got help to find how it works, thanks for help! Please see the the second Post of RedZenBird
Thanks,
|
|
|
|
|
did you try Yes/No ? Not sure if it'll work, but I just used Access to define a test table, and it called the column type a yes/no column.....maybe that's a valuable hint. If that doesn't work...then I don't know
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Hi,
I got help to find how it works, thanks for help! Please see the the second Post of RedZenBird
Thanks,
|
|
|
|
|
I've confirmed that Yes / No works. Also True / False .... Seems maybe its case sensitive (?)
Just trying to keep the forces of entropy at bay
|
|
|
|
|
Hi RedZenBird,
Thank you very much for your help, it works great!
Many thanks,
Anh
|
|
|
|
|
Hi RedZenBird,
Thank you very much for your help, it works great!
Many thanks,
Anh
|
|
|
|
|
I've worked with both Access and SQL Server SQL statements and found a little inconsistency in the way that both platform represents a boolean value!
However I've found that FALSE is always represented as 0 (zero), and TRUE as any non-zero value. Access will sometimes store TRUE as -1.
So to query a boolean field I use :
"SELECT * FROM [Sample] WHERE [Logic]=0" // FALSE
"SELECT * FROM [Sample] WHERE [Logic]<>0" // TRUE
|
|
|
|
|
Hi,
I got help to find how it works, thanks for help! Please see the second Post of RedZenBird
Thanks,
|
|
|
|
|
My teacher says there isn't but...
There's got to be a better way to do this...
Organism aOrgArray[iColSize] = {Organism iNumChroms),Organism (iNumChroms),
Organism (iNumChroms),Organism (iNumChroms),Organism (iNumChroms),Organism (iNumChroms),
Organism (iNumChroms),Organism (iNumChroms),Organism (iNumChroms),Organism (iNumChroms),
Organism (iNumChroms),Organism (iNumChroms),Organism (iNumChroms),Organism (iNumChroms),
Organism (iNumChroms),Organism (iNumChroms),Organism (iNumChroms),Organism (iNumChroms),
Organism (iNumChroms),Organism (iNumChroms)};
iColSize = 20 for this prog
The constructor for class Organism takes an integer argument, iNumChroms, that has no default value. A default would be acceptable if it would help me clean up this ugly delcaration! What if it needed to be 1000!?
|
|
|
|
|
You've answered your own question. Provide a default constructor, and a method to set the number of Chromosomes. Then you can set them in a loop, no matter how many there are.
Or create them on the heap. Then you can call new on them in a loop and pass in your variable.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|