|
I see! I hope you'll bear with me, I am a newbee in database programming...
Let me ask you though, is there any MFC class supporting ADODB connections?, I've been searching but found none...
For what I could see, ADODB connections are a form of interacting with databases through OLE ?
|
|
|
|
|
MFC doesn't provide a class for connecting to database using ADODB, that's why I programmed my own CDatabase class that #imports the ADO DLL to use the wrapper classes, and call the more common methods, for example, Execute to execute a query.
In order to fully understand, you need knowledge on COM technology.
I think here in codeproject you may be able to find info on this topic (in www.google.cl you can find a lot of stuff, for sure)
Jaime
|
|
|
|
|
Thanks a lot for all the input, Eduardo!
Cheers,
David
|
|
|
|
|
you are welcome... but my name isn't Eduardo, it is Jaime, and my surname Stuardo
|
|
|
|
|
I am sorry for having mixed up your name, Jaime!
Again, thanks for the help!
David
|
|
|
|
|
I haven't used the MFC database classes for quiet a few years. I much prefer to use ADO.
There are some nice wrapper classes here[^]
Michael
CP Blog [^]
|
|
|
|
|
hi!
i'm a newbie to MFC socket functions, pls help =)
i have an existing dialog based MFC project. now i need to add this function: receive text from another PC and reflect it on my user interface.
is there a simple way this can be done? i wonder if anyone has done something similar?
|
|
|
|
|
pork chop wrote:
is there a simple way this can be done
"simple" is relative
pork chop wrote:
i wonder if anyone has done something similar
Is that a rhetorical question? Of course they have.
pork chop wrote:
receive text from another PC and reflect it on my user interface
Well I assume you know how to "reflect text on your user interface" so that just leaves "receive text from another PC". Unfortunately that does not provide anywhere near enough information for anyone to begin helping you.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Helo everyone,
I'm building a MDI App and I want to open an specific view once only from CMDIFrameWnd, and detect if this view is open to activate.
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
For that document types OnNewDocument()
CDocTemplate *pTemplate = GetDocTemplate();
POSITION pos = pTemplate->GetFirstDocPosition();
if (pos != NULL)
{
// a document of this type exists already!
// need to get its view and then call MDIActive on it
// and return FALSE
}
If you vote me down, my score will only get lower
|
|
|
|
|
<br />
<br />
<br />
#include "Utility.h"<br />
#include <Af_irda.h><br />
<br />
#define IRDA_DEVICE_LIST_LEN 16<br />
#define IRDA_TRY_COUNT 30<br />
#define IRDA_TRY_SLEEP_MSEC 1000<br />
<br />
int DevListLen = sizeof(DEVICELIST) <br />
* IRDA_DEVICE_LIST_LEN;<br />
<br />
int EnumTest(void);<br />
PDEVICELIST EnumIrdaDevices(void);<br />
BOOL EnumIrdaDevicesTest(void);<br />
<br />
int ExecuteIrdaEnumTest(void)<br />
{<br />
int result;<br />
result = EnumIrdaDevicesTest();<br />
<br />
return result;<br />
}<br />
<br />
int EnumIrdaDevicesTest(void)<br />
{<br />
int iDeviceCount;<br />
PDEVICELIST pDevList;<br />
<br />
int iTryCount = 0;<br />
int iDeviceIndex = 0;<br />
<br />
char* scs = "|/-\\|/-\\";
short scsLen = (short)strlen(scs);<br />
int schrIndex = 0;<br />
<br />
printf("Searching for infra-red devices in range... ");<br />
for (; iTryCount < IRDA_TRY_COUNT; iTryCount++)<br />
{<br />
if ((pDevList = EnumIrdaDevices()) != NULL)<br />
break;<br />
<br />
schrIndex %= scsLen;<br />
printf("\b%c", scs[schrIndex++]);<br />
<br />
free(pDevList);<br />
Sleep(IRDA_TRY_SLEEP_MSEC);<br />
}<br />
<br />
if (pDevList)<br />
{<br />
printf("\n\n#%u device(s) has been found, enumerating...\n\n", pDevList->numDevice);<br />
iDeviceCount = (int)pDevList->numDevice;<br />
for (; iDeviceIndex < iDeviceCount; iDeviceIndex++)<br />
{<br />
printf("Device Info #%u :\n", (iDeviceIndex + 1));<br />
printf(" Name: %s\n\n" , pDevList->Device[iDeviceIndex].irdaDeviceName);<br />
}<br />
}<br />
<br />
free(pDevList);<br />
return (pDevList != NULL) <br />
? BE_SUCCESS<br />
: BE_ERROR;<br />
}<br />
<br />
PDEVICELIST EnumIrdaDevices(void)<br />
{<br />
int iResult;<br />
u_long index = 0;<br />
SOCKET sock;<br />
PDEVICELIST pDevList;<br />
<br />
sock = WSASocket(AF_IRDA, SOCK_STREAM, 0, NULL, 0, <br />
WSA_FLAG_OVERLAPPED);<br />
<br />
pDevList = (PDEVICELIST) malloc(sizeof(DEVICELIST) * DevListLen);<br />
<br />
pDevList->numDevice = 0;<br />
iResult = getsockopt(sock, SOL_IRLMP, IRLMP_ENUMDEVICES, <br />
(char *)pDevList, &DevListLen);<br />
<br />
<br />
if (pDevList->numDevice > 0)<br />
return pDevList;<br />
else<br />
{<br />
free(pDevList);<br />
pDevList = 0;<br />
return NULL;<br />
}<br />
}<br />
your life is what you believe
|
|
|
|
|
You only free pDevList if nothing is found.
You must have a pointer, linked list etc. in the calling function so the calling function can free memory after it is finised with the list.
Elaine
The tigress is here
|
|
|
|
|
Hello,can anyone help please(my second for today),
How can i open a file(for exemple d:\Temp\log.txt) through pushing a button in my MFC project?
Thank you all!
Johnny
|
|
|
|
|
Call ShellExecute with operation "open"
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
Thank you very much!!!
It works!
Johnny
|
|
|
|
|
Are you wanting to know how to:
1) respond to a button click
2) open the file using its associated application
3) open the file within your application
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thank you! but i already got help
thanks
Johnny
|
|
|
|
|
Hai all,
I am developing an application in VC++ MFC.
Then i have to migrate it to WinCE.(eVC++ 4)
In my application, I applied masking over the button controls on a dialog to load a bitmap of rounded rectangle shape.
If the buttons are transparent , the masking can be performed.
But there is no transparency option in WinCE.
How can a button be made transparent?
Please help me..
With thanks and regards
T. Arun Chakaravarthy
|
|
|
|
|
I am trying to program a notification popup that is similar to Outlooks message when you get a new email. What I am trying to accomplish is if the user is in another application and has our application minimized that a popup message appears on the screen notifying them of work that they have to perform. I would like this popup to appear regardless even if the all windows are minimized. I have tried variations of the following code
SetWindowPos(hwndOwner,HWND_TOPMOST,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_SHOWWINDOW);
SetForegroundWindow(hwndOwner);
SetFocus(hwndOwner);
stat = MessageBoxEx((HWND)Uxvt_vobj_get_attr(win, ATTR_NATIVE_WINDOW),u_str_ptr(mh), u_str_ptr(th), buttons | icon | defbutton | modalflag | miscflags,MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));
The best I have been able to come up with is a message that spans all windows which is a start but it only appears if I give focus to our application and then click on another application - I need it to do it regardless of focus - any ideas? Thanks Rider
|
|
|
|
|
Explain the reason you are passing in SWP_NOZORDER and SWP_NOMOVE? Given that the window is minized, how is SWP_NOZORDER going to affect focusing the window?
Kuphryn
|
|
|
|
|
Have you tried changing the modality of the message box, like:
MessageBox(..., MB_APPLMODAL);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am trying to find a way to send an interrupt to a process. I have put a GUI around a "console application" and redirected its output to the GUI. Now I need a way to send a CTRL-C to the "Console App".
Any help would be greatly appreciated.
Thanks
DCrawford999
|
|
|
|
|
|
It's a bitch!
Anyhow here is the thing I got myself a string, just a word.
I need to locate a char in it and then erase it, also it must be done in a loop so that if char is in there twice etc. it would be deleted.
Problem: What if char doesn't exist in the string.
I tried to use if( !(blahblah.find(char)) ) doesn't work because if .find
doesn't see the char it throws the value of char position out of range of length of string or drops it bellow zero, causes an out of range error.
(This took me half a day to figure out)
So I used: if( (blahblah.find(char) < 0) || (blahblah.find(char) => Length) )
same crap!
Two hours later found strpbrk()!
How can I use it together with strlen to simplify the condition and avoid
out of range error during run-time.
Basicaly what I need is to look at a string, single word. Check if it has a char I provide. If it doesn't I need the if-statment to fall thru.
But if it does have it I need to erase it, this I can do .
|
|
|
|