|
Do you mean Recordset or Record?
Have a look here http://www.codeproject.com/database/#ADO[^]
Michael
Life’s not a song.
Life isn’t bliss.
Life is just this.
It’s living. -- Buffy the Vampire Slayer: Once more, with feeling
|
|
|
|
|
a Record
|
|
|
|
|
I am writing an AppWizard, which I would like, amongst other things, to generate and name certain folders in the File View section of the Workspace.
Does anybody know how to generate folders that are name differently from the usual "Source Files", "Header Files" and "Resources" folders.
|
|
|
|
|
hi,
i'm using odbc with my application.. i was able to execute sql statment in odbc, using pDB->m_pDatabase->ExecuteSQL("select * from [table]"), but i don't know how to get the result from the ExecuteSQL function after the query has been successfully executed.. can someone plz show me how the query results are obtained from the ExecuteSQL function.. thank you!
|
|
|
|
|
You can't get results from an ExecuteSQL call.
From MSDN
Create the command as a null-terminated string. ExecuteSQL does not return data records. If you want to operate on records, use a recordset object instead.
Most of your commands for a data source are issued through recordset objects, which support commands for selecting data, inserting new records, deleting records, and editing records. However, not all ODBC functionality is directly supported by the database classes, so you may at times need to make a direct SQL call with ExecuteSQL.
Michael
Life’s not a song.
Life isn’t bliss.
Life is just this.
It’s living. -- Buffy the Vampire Slayer: Once more, with feeling
|
|
|
|
|
What I tend to do is derive a class from CRecordset for each "query" i have, then change the GetDefaultSQL() function so that the default SQL statement (used to return rows from the database) can be built from things like member variables which you can set from your app. Then calling Open() on your CRecordset derived class opens the database using the default SQL statment you specified in GetDefaultSQL() .
Hope this helps
-Alex
|
|
|
|
|
I need to do multicasting on our local university LAN(ethernet).
Ive been tryin to make a MADCAP(Multicast Address Dynamic Client Allocation Protocol) client to do this (MADCAP is an API in teh platform SDK). We have configured a MADCAP server at the server end.
im tryin to get the address through McastRequestAddress() function but it returns a value of 87 which probably stands for an invlid parameter
here is the code:
void CMainFrame::OnMulticast()
{
DWORD m_chk, m_chk1, m_chk2, m_chk_last;
PDWORD pVersion = new DWORD;
*(pVersion) = 1;
m_chk2 = McastApiStartup(pVersion);
//for parameter 2
LPMCAST_CLIENT_UID pRequestID = new MCAST_CLIENT_UID;
pRequestID->ClientUID = new unsigned char[17];
for(int c=0; c<17; c++)
{
pRequestID->ClientUID[c] = c;
}
pRequestID->ClientUIDLength = 17;
m_chk1 = McastGenUID(pRequestID);
//for parameter 3
PDWORD pScopeCount = new DWORD;
PMCAST_SCOPE_ENTRY pScopeList = new MCAST_SCOPE_ENTRY [90] ;
PDWORD pScopeLen = new DWORD;
*pScopeLen = 90;
m_chk = McastEnumerateScopes(AF_INET, TRUE, pScopeList, pScopeLen, pScopeCount);
PMCAST_SCOPE_CTX pScopeCtx = &(pScopeList->ScopeCtx);
//for parameter 4
PMCAST_LEASE_REQUEST pAddrRequest = new MCAST_LEASE_REQUEST;
pAddrRequest->LeaseStartTime = 0;
pAddrRequest->LeaseDuration = 0;
pAddrRequest->AddrCount = 1;
pAddrRequest->pAddrBuf = new BYTE[4];
for(int i=0; i<4; i++)
{
pAddrRequest->pAddrBuf[i] = pScopeList->LastAddr.IpAddrV6[i];
}
pAddrRequest->ServerAddress = pScopeList->ScopeCtx.ServerID;
//for parameter 5
PMCAST_LEASE_RESPONSE pAddrResponse = new MCAST_LEASE_RESPONSE;
pAddrResponse->pAddrBuf = new BYTE[4];
//the real thing
m_chk_last = McastRequestAddress(AF_INET, pRequestID, pScopeCtx, pAddrRequest, pAddrResponse);
}
There are no examples given with this API
can any one please guide me as to which parameter am i passing incorrectly.
Or tell me some other way through which i can multicast on LAN.
I'd be really grateful
|
|
|
|
|
Hi,
In want to include an address bar in my application, somewhat like IE has. I use a CDialogBar to accomplish this. On the CDialogBar is a CStatic and a CEdit control. My problem is that I cannot find a way to respond to sizing messages for the CDialogBar. I want the CStatic control to stay the same size and the CEdit control to cover the rest of the CDialogBar. When the CDialogBar gets bigger or smaller, so should the CEdit control.
Can anyone help me here.
Thanks,
Woody
|
|
|
|
|
I've read a quote from MSDN document. Can any one tell me the meaning of "atomic" in this quote:
The InterlockedExchangeAdd function performs an atomic addition of an increment value to an addend variable. The function prevents more than one thread from using the same variable simultaneously.
|
|
|
|
|
atomic means self contained and, I believe, thread safe. Yes, having read the rest, that is exactly what it means. It means that no matter what another thread is doing, the operation will succeed.
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
|
|
|
|
|
Okay, I will give it a try.
Its probably single unit of execution in the CPU, like an addition operation requires a single instruction.
Also can it be an operation which cannot be reduced further (doing which will defy the logic or something of that sort) for ex. in a complex piece of algorithm where in a single step would involve, two operations which has to be performed consecutive i.e it should be performed in a single step.
someone tell me if this is a right interpretation.
Cheers
Kannan
|
|
|
|
|
In this context, atomic means an operation which is guaranteed to never be interrupted until the operation is done. So once an InterlockedIncrement() call begins, your thread won't get preempted in the kernel while executing the code for that API.
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
The font dialo box works fine, but I need to start the application with a specific and attribute.
|
|
|
|
|
I have declared a global integer variable in my program.but whenever i try to access this variable inside a keyboard hook function,i get
the value of the variable as 0.But when accessed from any other function,I am geting the correct value.
|
|
|
|
|
Do you mean hook by SetWindowsHook() function?
Is your function in DLL?
I guess problem should be:
The global variable is global in process(module), but
function is called from another one (process).
You need global variable in shared section.
(all modules shared one)
Maybe....
Viliam
|
|
|
|
|
yes, with SetWindowsHook() .
this is not a DLL.
I meant those variables declared at the begining of the file
|
|
|
|
|
Try this:
#pragma data_seg(".shared")
int iSharedVar = 0;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.shared,RWS")
more:
http://support.microsoft.com/default.aspx?scid=KB;en-us;q125677
Viliam
|
|
|
|
|
That code didn't work out.
The code was pasted on the top of the page.
on initdialog i set iSharedVar=100;
but,in the callback function , it was zero.
|
|
|
|
|
Sorry, that was all what I known.
I always had hook callbeck function in DLL module and
all global variables worked well.
Now, I realy don't know where problem should be.
viliam
|
|
|
|
|
Hi,
I have 1 Desktop & 1 Laptop on my Home network, I use MS Network to setup a Home Group and look like this in Explorer:
- Entire Network
Home
Desktop
Laptop
I am using VC++6.0 to scan their IP address (just to know: are they connected on the Home Network?) ... and I using these following codes:
<code>
DWORD dwSize = 0 ;
GetIpAddrTable( NULL , &dwSize, FALSE ) ;
PMIB_IPADDRTABLE pIpAddrTable = (PMIB_IPADDRTABLE )new BYTE [ dwSize ];
if (pIpAddrTable )
{
if (GetIpAddrTable( (PMIB_IPADDRTABLE)pIpAddrTable, &dwSize, FALSE) == NO_ERROR )
{
for(int nEntry=0;nEntry < pIpAddrTable->dwNumEntries;nEntry++)
{
trial.S_un.S_addr = pIpAddrTable->table[nEntry].dwAddr;
pIP = inet_ntoa(trial);
}
}
</code>
It supposes to show "all IP adresses" that connect to my Home Group ... instead, it shows me only the IP address of the PC that I launch these codes!
I notice that if I use:
<code>
GetNumberOfInterfaces(&inter_face);
</code>
Then inter_face shows there are 2 interface did connet to my Group Network, if so ... can some one show me how to get the IP address of each interface?
Many thanks to any suggestion here!
|
|
|
|
|
Hi
I am wondering what is the best way to draw a pixel (I will need to draw a lot of them) onto a DirectDrawSurface7
reading the dx docs. there dosn't seem to be a set pixel..
I was thinking of either getting the DC and using GDI to plot it (would be slow)
or
creating several small surfaces (1 pixel) of the colours I want (only 3) and blitting them on as required..
any suggestions ??
Cheers
Chris
|
|
|
|
|
Get the DC, create a DIBSection, set the pixels, copy to the DC.
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 Christian
another quick question..
I want to take the finished image and basically double up its size but leaving a blank between each pixel..
(basicaly I am making a pinball dmd)
I could (offcourse) draw it like that but I want to also do a background image (from another source (bit like an animated gif) and merge it in with my dots..
i was thinking to copy it line at a time (first vertical and then horizontal) into 2 other surfaces (of the new expanded size).
|
|
|
|
|
They are stored in lines, so it would be very simple to write a function that copies a bitmap into one twice it's size and steps through the destination pixels in 2's across and or down. Do you want to create the illusion of scanlines ?
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
|
|
|
|
|
a simular type of effect.. both horizontal and vertical (at the same time).. double spacing sort of thing where the space is 100% black and not aliased.
|
|
|
|