|
I was hoping someone could point me to a good resource that would explain how to access data in MS Access database, join tables, get specific information (not info from all columns), and export the data in an excel file. I know this is a lot to ask for but if there was a resource on the MS Access portion (getting and joining), that would be more than sufficient. I have looked at various articles on this website and found them useful to the point that I can now open a MS Access db and get the information from one table but I need certain information from several tables that need to be joined. Any ideas?
|
|
|
|
|
well as far as accessing access database is concerned there is nothing better than Visual Basic as it provides in built functions for all kind of data processing. and moreover if u will search this site a bnit more u will be able to find urself various means to export the data to any other application including excel. cheers!
Sachin Jain
Software Developer
|
|
|
|
|
I have for some time used a small DLL that, when loaded, then loads a VB ActiveX dll by creating an instance of its registered class.
I can inject this DLL into any target process without problem, but only if I use a hook-based injection method. If I inject it with CreateRemoteThread (using LoadLibrary, etc) the DLL falls over trying to create the same objhect.
Does anybody have any idea what the difference might be?
Cheers
|
|
|
|
|
How can I get the HDC from CBitmap or HBITMAP in Visual C???
I need to use BitBlt:
BOOL BitBlt(
HDC hdcDest, // handle to destination DC
int nXDest, // x-coord of destination upper-left corner
int nYDest, // y-coord of destination upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXSrc, // x-coordinate of source upper-left corner
int nYSrc, // y-coordinate of source upper-left corner
DWORD dwRop // raster operation code
);
but I don't know how to get the HDC from a CBitmap or a HBITMAP from BMP files.
Tkz
MarQua
|
|
|
|
|
HDC does not come from the CBitmap or HBITMAP. If you want to get the HDC for a window do something like below:
CDC* pDC = GetDC();
HDC hdc = pDC->GetSafeHDC();
:
:
ReleaseDC(pDC);
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
I think this should do the trick....
CDC dcMem;
CPaintDC dc(this);
//create a compatible dc
dcMem.CreateCompatibleDC(&dc);
// Select the bitmap into the in-memory DC
dcMem.SelectObject(CBitmap::FromHandle(m_hBitmap));
dcMem.DeleteDC();
Then in Bitblt u can use dcMem.m_hDC
|
|
|
|
|
mahade1 wrote:
Then in Bitblt u can use dcMem.m_hDC
Only before the dcMem.DeleteDC() line...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I have been trying to store away an array of variables that I wish to display via a general display routine (i.e. deal with any type of variable).
e.g.
typedef struct<br />
{<br />
void* data [10][20][20];<br />
DATA_DETAILS dataDetails[10][20][20];<br />
short feildsInDisplay [10][20];<br />
}DISPLAY_DB;<br />
<br />
DISPLAY_DB myDB;<br />
<br />
myDB.feildsInDisplay[0][0] = 2;<br />
myDB.data[0][0][0] = &(shortInteger1);<br />
myDB.dataDetails[0][0][0] = short_integer_details;<br />
myDB.data[0][0][1] = &(float_data_item);<br />
. etc
At some point later in the program
dataStr.Format ("%d", myDB.data[0][0][0]) ;<br />
strName = myDB.dataDetails[0][0][0].fieldDesc;<br />
m_cEditTest.SetWindowText (strName + dataStr);<br />
What I get is the correct dataDetails but the address of the data not the data itself. How do I dereference this data.
e.g. Test Data 1 = 438181 and not Test Data 1 = 1234
If I try dataStr.Format ("%d", *myDB.data[0][0][0]); I get an illegal indirection error.
Also I cannot store away the address of bit fields I get the following errors
c:\Export_LibDlg.cpp(479): error C2104: '&' on bit field ignored
c:\Export_LibDlg.cpp(549): error C2100: illegal indirection
where the data is
unsigned dataBit : 4;<br />
<br />
myDB.data[0][0][0] = &(dataBit);<br /> Any suggestions,
grahamfff
|
|
|
|
|
myDB.data[0][0][0] is a void* so if you say *myDB.data[0][0][0] you should get an illegal indirection.
Try (int*)myDB.data[0][0][0] in your format. Could be wrong.
|
|
|
|
|
Actually, if u r setting myDB.data[0][0][0] to a short integer (as the name says), then it would be wiser to use (short int *)myDB.data[0][0][0] in your format.
|
|
|
|
|
Grahamfff wrote:
Also I cannot store away the address of bit fields
That's correct. This is prohibited by the C standard. This is simply because if the field starts part-way through a byte, there is no way the compiler can take its address - it has to be on a byte boundary.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
If anyone can help me with a character counter, I would be very appreciative.
I have a Rich Text Edit box in an MFC app. I would like to limit the number of characters a user enters by having a "Characters Left" count box below my edit box indicating how many additional characters the user has left. This counter chould be dynamic enough so users would actually see the number decrement by one for each character typed, and if they deleted a 5 letter word, it should go up by 5.
In addition, when the counter is 0, the edit box should not allow any more input.
This should be similar to the java script done on many HTMLs.
Anyone ever done this before in C++ MFC? Can anyone provide me with a suggestion on where to begin?
Thank you!!!
|
|
|
|
|
Hi!
the "normal" edit control has a method, that allows you to set the maximum input len. So I guess, the RichEditControl has some similar method.
and then, you can catch the TEXT_CHANGED message
(don't know the correct name ) , get the text from the control, calculate the Len and update your "counter" control.
|
|
|
|
|
Yea, I know the "concept" behind what I need to do, I just cant find any specifics. TEXT_CHANGED is nice, but again, the real name alludes me. I simply cannot find it and I am getting a little frustrated.
|
|
|
|
|
It seems, you must derive a class from CRichEditCtrl and catch the WM_KEYUP message. Don't know why, but my parent window don't get any messages from the RichEdit
|
|
|
|
|
Yea, it seems that the parent window doesn't get the KEYUP message with me either and that was the problem I was having.
I solved this problem by adding a message handler to the IDC_EDIT for EN_CHANGE messages. That worked great. I dont understand how or why it works with a rich edit, but who knows...and at this point who cares.
Its done!
Thanks for the help.
|
|
|
|
|
I have a MDI app which has a feature to allow the child frame to be outside of the mainframe, the child frame is clipped by main frame by default.
how should i implement it?
Thanks.
I love C++
|
|
|
|
|
I've been experiencing a strange anomaly at runtime with a Windows API based exe.
When stepping through my WinMain function, I realised that the arguments passed to it by Windows (HINSTANCE, HINSTANCE, CHAR*, INT) are basically corrupted. The two HINSTANCEs are always 0 and the last two arguments are different every time (ex. -15423002).
Has anyone else encountered this sort of problem?
Note:I had a linking error before: 'unresolved external wWinMainCRTStart' or something like that that I kludged by setting the property Advanced>Entry Point to 'WinMain'; could this be the reason? By the way I used VS.NET 2003 to compile and link.
kern
|
|
|
|
|
KernKraft33 wrote:
Note:I had a linking error before: 'unresolved external wWinMainCRTStart' or something like that that I kludged by setting the property Advanced>Entry Point to 'WinMain'; could this be the reason? By the way I used VS.NET 2003 to compile and link.
Sounds like a reasonably bet to me. Mind you I'm not using VS.NET.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
The answer would be yes. The prototype of wWinMainCRTStart is "int x (void)". So replacing that with a "int (HI, HI, CHAR*, int) routine would result in all sorts of funning things going on.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I have a dialog app, i use the OnMouseWheel to modify the pos of an slider control. This is the problem i have: it only works only if i hold the shift or the ctrl key pressed, or if i press any button before trying to use the wheel. Any suggestion,please ?
|
|
|
|
|
While implementing PrintPreview how can i find out of the user is zooming in the PrintDialog .
My Code is seeing this as a request to print the next page . so if you have 2 pages 1 and 2 . When u select Print Preview , one gets to see Page 1 unzoomed , when I zoom using the Button , the OnPrint method is called again and Page 2 is drawn (inspite of the status bar showing Page 1) . The behaviour that I want is Page1 being redrawn again .
Can I get this info from the CPrintInfo pointer ?
Engineering is the effort !
|
|
|
|
|
I am a student at DeVry University and i'm working on my senior project. We are making an iris scanner that takes a picture of the eye and we manually click points to be compared with pictures saved in the memory and determine wether or not that person gets access. What we are trying to do is get a picture from a camera that is uncompressed and compress it into a picture format probably .bmp because it's easier to work with in MFC.
We are trying to make and MFC gui that will receive the picture serially from the camera or from a pre-defined location on the hard drive and display it to the screen. Then we want to be able to click anywhere on the picture and get the X and Y coordinates and the color of that certain pixel. Now I have been looking for serial communication and picture display examples, but the serial examples are very different from one to another and I don't really understand what is all needed to just set it up to receive data like when a button is pressed or when it receives and event.
The picture display examples I have seen all want you to already have the pictures and none of them show you how to open a picture from a file or just automatically display the picture from a pre-defined location. Also I was looking at a function that formats a picture from a stream of data, but i'm not sure what format the picture is comming in from the camera.
It is a CCD camera that is analog so we are running it through an ADC to make it digital but we don't know what format the picture is comming in as becuase it is a full motion camera so we will have to activate it and de-activate it and catch that data stream. So we are kind of lost because all of this stuff is new to us besides the programming that will be done on the microcontroller. We have done C++/MFC/C but we haven't used any of these functions or procedures so if ANYONE can help me I would greatly appreciate it.
Thanks,
Jeremie Jackson
|
|
|
|
|
well, I sure dont have the answer to ur questions, but have a suggestion to make. Why dont u try organising ur huge question into paragraphs, so that will improve its readability!!!
Also I didnt get what u meant by the following:
JeremieJ wrote:
The picture display examples I have seen all want you to already have the pictures and none of them show you how to open a picture from a file or just automatically display the picture from a pre-defined location.
Good Luck with ur project.
Mahadevan.
|
|
|
|
|
I mean that they want you to code the picture into the program and they don't show you how to open a picture from the hard drive and display it to the screen or automatically display a picture to the screen when u press a button. You know like open a picture and display it to the screen like paint.
|
|
|
|