|
You may want to start by deciding what database access technology you're going to use...
For Microsoft possibilities, see: Data Access Technologies Road Map[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark. Tnx for the reply.
im going to use ado.
i have this sample code already... which returns only a single record.
what i am doing is i just get the values of the fields i need and assign it to a variable.
szSQL.Format(_T("select * from table where key='101'");
hr = pRS.CreateInstance(__uuidof(Recordset));
if (FAILED(hr))
return false;
if (!pRS->adoEOF)
{
pFields = pRS->Fields;
pField = pFields->Item[_T("id")];
_variant_t var = pField->Value;
szID = TrimBSTR(var.bstrVal).copy();
pField = pFields->Item[_T("count")];
var = pField->Value;
szCnt = TrimBSTR(var.bstrVal).copy();
}
now what i am not sure how to do is how to map the result of the query to structs if the return is multiple records. i would like to have the results of the query be stored in an array of structs. do i do the same thing of accessing each fields and creating the struct. i was hoping there is an easier way. thanks!
newbie
|
|
|
|
|
Am kinda new visual c++, is there anyway to use the header file afxwin.h in maybe Dev Bloodshed IDE, I want to create native button son MFC and i guess its wrong to use samn like CButton buttonname;
and also are the syntax and style of the c++ coding in VS6.0 different here in VS8.0?
ANY HELP? Thanks.
phatkin
|
|
|
|
|
I use VC2005.In a project,there is a dialog with a datagrid control.But when I move the project to antother PC,the dialog recouse couldn't be opened now.An assert occur,it tells me that the active contol was not registed!
Someone would like to tell me why? The environment of the two PC are same(VC2005)!.
Thanks.
GOOD LUCK
|
|
|
|
|
Good day. I am looking for a possibility to change windows message.
For example, when I insert a disk with corrupted file system and try to access it with windows explorer, I found out that windows explorer will prompt me a message "Please insert a disk into drive A:".
Is is possible for me to change the "Please insert a disk into drive A:" into another message like "Please format your disk..." or launching windows format or launching other application?
|
|
|
|
|
Hirakawa wrote: when I insert a disk with corrupted file system
How will you know the disk is corrupted versus the floppy drive just can't read the floppy.
Over the years in I.T., I have found that floppies formatted and populated by one box sometimes cannot be read by other machines. This seems to have gotten worse in the last several years.
Just because a floppy drive cannot read the disk does not necessarily mean the disk structure is corrupted. It may just have trouble picking up the flux reversals and hence voltage levels of the signal fall in the indeterminate region between high and low.
"Please insert a disk into drive A:" means I can't read your disk.
"Please format your disk" could be interpreted as, I can read your disk, but you disk structure is shot. However, we are not sure why it can't read the disk. It's probably safer to leave it open to other possibilities so the user still has some hope that another floppy drive may pick up on the flux reversals before suggesting they wipe out the data on the disk permanently.
Just my two cents
|
|
|
|
|
Thank you for your reply.
I just want to change the windows message or behavior. Whether disk is corrupted or floppy drive have problem is not in my consideration at the moment. I just want to explore the possibility to manipulate the windows message.
|
|
|
|
|
Hi Guys
i am trying to disable only External hard disk not USB Flash key.. which is being mounted from USB Port.
i am using DeviceIoControl for vlocking the device but it taks too much time. so in mean while people can hack the drive.
i want to do all at run time.. please it is very urgent
Thanks in advance
R e h a n
|
|
|
|
|
What control code are you using for DeviceIoControl()?
Does your program have sufficient administrator priviliges? (It must be running at administrator level for Device IO commands)
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
I want to develop one program to solve screen recording , please give me an example,Thank you.
|
|
|
|
|
youthdragon wrote: I want to develop one program to solve screen recording
Have fun with that then
|
|
|
|
|
|
What do you want your program to do?
What are the tasks required to do this?
Which task(s) are you having trouble with?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Is it possible for a process to retrieve a Primary Token for whichever user account it is running under?
Can I then pass a handle of the token to an admin process, which would allow that admin process to use CreateProcessAsUser to create new processes in the context of the original user account?
Background:
I have a program that launches an updater program which requires admin privileges. After it performs the update, I need the updater to re-launch the main application, but under the regular user account, not the admin account.
This is Vista.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Why can't the main application be run from the admin updater program? It would run under admin privileges.. But does this matter?
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Thanks for your reply. Unfortunately, it actually does matter which account it runs under, because a lot of application config is user account-specific, so the app must be run under the account of the person who wants to use it.
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
You could do something like create a small "in-between" program, running at user level, which runs the program set at admin level, and then runs the user-level app again? Or something similar to this?
Also, I'm sure that there is an API for elevation of an application.. So you create your admin-level application running as a user then elevate it to admin level?
Also, does this admin app have to run the user level app again? Can't you just hide the main window whilst the admin application is running, and get the admin level app to show it after it has finished?
I hate Vista too
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Yes, your "in-between" idea might work. Thanks very much.
I wouldn't be able to keep the user-level app running while the admin app is doing its thing, because the admin app is an updater whose job is to replace application binaries with new versions!
So your in-between program idea might work as long as the in-between program itself never needs updating......
But I will seriously consider your idea if I can't find anything more direct.
Thanks very much!
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Ah I see why my other idea wouldn't work. Sorry I was unclear.
And you're welcome I hope this method works
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
BOOL SomeFunc( LPSTR* arString )
{
//
return TRUE ;
}
void main()
{
//declare ??
BOOL bRet = SumFunc(??) ;
//HOW can i declare the varible for passing argument to LPSTR* arString and how to pass this to SomeFunc
}
//is there any other way to retrieve array of string from a function , is the method used above is correct for for this purpose ?
//thanks
|
|
|
|
|
LPSTR strA;
LPSTR strB[ 100 ];
<br />
SomeFunc( &strA );
SomeFunc( strB );
When passing arrays around, it is wise to also pass the number of members. To make life easier just use std::vector.
std::vector< LPSTR > vStr;<br />
<br />
BOOL SomeFunc( std::vector< LPSTR >& vStrings );<br />
|
|
|
|
|
WalderMort wrote: When passing arrays around, it is wise to also pass the number of members. To make life easier just use std::vector.
He's not asking to pass arrays around, he asking how to pass a pointer to a pointer into a function.
Kinda like here's pointer, allocate something for me then modify my pointer to point to it.
|
|
|
|
|
Well, maybe your right. I got caught up in the LPSTR* thing but now that I reread it, your probably right.
My bad
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">nitinmx wrote:</div>BOOL SomeFunc( LPSTR* arString )</blockquote>
LPSTR* is a pointer to a pointer. I am assuming you want the function to allocate some memory and modify your pointer to point to it. If this is what your after, here's a sample...
int CTestPPView::SomeFunc(LPSTR* pPointer)
{
ASSERT(pPointer);
ASSERT(*pPointer==NULL);
char* pString="This is a test";
int nLength=strlen(pString)+1; // Add one for null terminator
// Modify the passed in pointer to point to allocation
*pPointer=new char[nLength];
if (*pPointer) {
strncpy(*pPointer,pString,nLength); // Copy some string to it
return nLength;
}
return -1; // Error
}
// In some method elsewhere...
LPSTR lpString=NULL;
int nLength=SomeFunc(&lpString);
if (lpString) {
TRACE("%s\n",lpString); // Just to display in debug
delete[] lpString;
}
-- modified at 12:14 Saturday 25th August, 2007
UPDATE: Now that I reread your post, I realize LPSTR* is not correct for what you are apparently trying to do. Waldermort appears to have interpreted correctly what you are asking for so just ignore my post.
|
|
|
|
|
Hello Friends i am using Win32 Application. And i want my dialog box to have some color on it rather than same old boring color..
can anybody plz tell me how to colour the dialog box and put pictures on it.
|
|
|
|