|
Does anyone have any suggestions on retrieving a recordset dynamically (this fields will be based on what the user chooses)? I tried using CRecordset, but it won't let me because the fields aren't bound. I've used ODBC before, but that seems kinda messy. In vb it's easy to use the connection's execute method of an ado connection that'll return a read-only recordset, but I'm trying to see if there's a similar method in C++. Any help would be greatly appreciated. Thanks in advance
If it's broken, I probably did it
bdiamond
|
|
|
|
|
bdiamond wrote:
I'm trying to see if there's a similar method in C++.
No, there is nothing similar in C++. There is however the exact same thing , ADO.
I recommend using the ATL libraries and the #import technique for working with COM interfaces in C++.
But, that's just my opinion... I could be wrong.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Sorry, after I went back home and looked through one of my books I found exactly what you were talking about! Thanks for your help
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Hello,
Inspired by Ivo Ivanov's article on process creation notification, I wrote a kernel-mode driver that notifies a user-mode application when a process is created. The driver itself works fine. However, when the driver is running, EnumProcessModules fails with the following error message:
"Only part of a ReadProcessMemory or WriteProcessMemory request was completed"
Here is more information on what I'm doing:
- When a new process is created, the driver passes the process Id to the user-mode application.
- Using the process Id, the user-mode application calls OpenProcess to obtain a handle to the process.
- The user-mode application then calls EnumProcessModules, which fails.
Two notes:
1) EnumProcessModules doesn't fail when the driver is not running.
2) EnumProcessModules doesn't fail when I'm debugging my user-mode application.
Jean Salvati
|
|
|
|
|
Anyone have any clues or code samples for pulling SCSI Controller BIOS information like the FirmWare Version that is not WMI? I'm looking at some Compaq SmartArray Controllers and need the FirmWare (Hardware Version (ROM)) Version which is blank using WMI.
|
|
|
|
|
Hi,
I've been using the CAviFile class to open an avi file in an MFC app in order to grab the first frame - this works for an avi where the codec is CRAM (Microsoft Video 1) - (bitmap header biCompression = CRAM). But when I try to grab a frame from an avi from a Fuji digital camera (biCompression = MJPG) it can't do. I suspect this is because Visual Studio can't find the
codec. I thought the required codec might be in the
quartz.dll but this is already in the VC98/Lib - ie its available to the app.
Has anyone got any ideas?
Paul
|
|
|
|
|
hi Guys..
i need help...
i want to connect to database using visual c++(API application)
not MFC application.
i want to open connection,manipulate data(insert,del...)
how can i do that ..
thank you for any help....
Amr..
Hawk,amr
|
|
|
|
|
There are lots of examples considering in using databases with the help of MFC or ATL. However, there are not many when it comes to plain Win32 programming, mostly because it becomes quite difficult.
For starters, I'd suggest you take a few hours off and digest the MSDN topic "ODBC Programmer's Reference" found here. This topic hosts all the concepts, functions, structures and whatever you need to utilize a database in pure Win32.
A whole lot easier (and nowadays more useful) approach is to use ATL/COM (ADO) to access the data source. This way, you don't need to resort to MFC overhead, but you can use pre-made or pre-configured components to fetch and send data from a datasource without much hassle. A few examples can be found here on Code Project from this link. Be careful, as we are only interested in ADO data access. There are many other articles in other sections at this area also, but many of them utilize MFC as their base.
The last resort, of course, is to use MFC. It's simple, it's efficient, it's easy to use.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi,
I am new to programmming and in a fit of practice I have developed a small, simple DataBase. It simply has the next, last, previous, first buttons with all the fields. I then started planning to have a list box off to the side that would display all the records in the recordset alphabetically. This got me thinking, although I have 1.5 Gigs of RAM, if I decide to let others use it, they may run out of memory as the DataBase gets bigger.
This brings me to the question (sorry it took so long), is there a way to have each record added to its own .text file and access each of those as needed? Closing out the last one open? I don't know how to read from txt files yet and thought if this sounds plausible to someone maybe they could direct me to some education on dealing with it. I'd really appreciate any guidance.
Garry
|
|
|
|
|
If you are new to programming, then trust me when I honestly say that programming a database system, simple or not, is NOT the thing to start with. It is very difficult to design a database (I believe that's why Oracle's database solutions cost so much ?), so perhaps you should try with something bit easier at first ?
Reading further into your post, I see that you're planning an approach that uses files as record storage. This is far from efficient, considering that your database could contain thousands of entries. And what about when it goes over that ? Searching and retrieving data from that would take a long time indeed.
The last point of problem relies in the query language. Most databases nowadays support Structured Query Language (SQL) that is already, by itself, quite difficult to implement, as it contains a whole set of conditional and operative instructions.
A much easier way to learn programming is to develop a small, simple database application that uses an already-existing database system (such as MySQL, Oracle or Microsoft SQL Server) to query for data stored there and displays it on a form view, for example. Speaking of form views, by the way, leads me to notify that the subject of your post and the context of it are in no way related. This should be avoided in the future.
In order to learn programming with Visual Studio, go to a local library and get any title starting with "Teach yourself Visual Studio 6 in xx days". These books, and there are numerous, are very useful in learning aids.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thank you for your guidance. Sorry about the discrepency between the subject and the body.
Garry
|
|
|
|
|
Zenix2 wrote:
...have a list box off to the side that would display all the records in the recordset alphabetically.
I personally would not want to wade through a listbox that contained thousands of items, even if they were sorted, not to mention how long it could take to load. You might want to consider a virtual listbox. It only bothers "loading" those items that are actually visible. All others are kept in a data structure.
Zenix2 wrote:
...they may run out of memory as the DataBase gets bigger.
This is unlikely since virtual memory will pick up the slack.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thank you David. How about a list box that rests under an edit field where the user would enter the first letter of the last name and have the list box display only the records according to the query?
I'm new enough to be kind of skittish working with SQL (but it is in the plans to tackle an education to that end), yet curious/ambitious enough to "play" around with this database. I'm learning quite a bit and am feeling more confident the more I succeed at a given task.
I appreciate your input.
Garry
|
|
|
|
|
Zenix2 wrote:
How about a list box that rests under an edit field where the user would enter the first letter of the last name and have the list box display only the records according to the query?
Yes, that's plausible.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks a lot David! I appreciate your guidance.
Garry
|
|
|
|
|
hi guys
i am new in winsock programming, in my code iam trying to login into the MSN server! for this iam using MS Winsock ActiveX Control! but this Component is not compatible with Visual C++.net, So i am searching for an article Describing how to Use a Winsock Socket to Connect to a server! and reciveing data from server (Like DataArraival event in MSWinSock ActiveX) and Send Data to Server! Just Like winsock activex.
i've found Begenning Winsock Programming - Simple TCP Client by Nishant but i dosen't help me out!
thanks in Advance
|
|
|
|
|
Ehsan-de-Burge wrote:
Simple TCP Client by Nishant but i dosen't help me out!
Could you explain how it does not help?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I've written an opengl program using mfc that works fine in winXP, but when I run it in win2000 it doesn't display anything in the viewport... not even the background.
I saw i glimpse of the display once when I had a MessageBox over it, so it may be a update problem!?
Anyone with good knowledge in opengl that can help me?
/PA
|
|
|
|
|
It can be many things. You should be more specific.
Try using glGetError (and gluErrorString) to isolate your problem. glGetError will work only if you made a mistake in your OpenGL calls, but your problem might be some OS issue.
Good luck.
Orhun Birsoy
|
|
|
|
|
Yeah I've checked the gl-calls with glGetError without finding any errors... no surprise really 'cos it works on one computer and opengl is platform indendent, right?
I've checked the return value of all strange operations like "wglMakeCurrent" and "SetPixelFormat" (it's all mumbojumbo to me), and all are OK except "wglCreateContext which returns TRUE but set the last error-variable to 8, which is "Not enough storage is available to process this command". This does not happen on the XP-machine.
As I mentioned I suspect it's a update problem. Is InvalidateRect(NULL, FALSE) enough to force a re-draw?
/PA
|
|
|
|
|
Is the operating system only changing factor here?
Is it possible that you are using some OpenGL extension(or feature) that Win2000 driver and/or video card of Win2000 machine does not support?
InvalidateRect should be enough. (If it is enough for XP it should be enough for Win2000 for such a basic function.)
Orhun Birsoy
|
|
|
|
|
It's solved now.
I found another sample code for the context creation which worked fine. I don't know what the problem was... nevermind.
Thanks anyway Orthun!
/PA
|
|
|
|
|
Hi,
some questions regarding GDI+ and general who to write code that demands high throughput.
1) I load an image with the image constructor of gdi. This takes about 20ms for an 720*565 RGB tiff image (1.6mb). This sounds eventually reseonable to me since random access of hdd should be about 8ms - 12ms. Question: could it be faster? Is 20ms to long? (I think about processing 30images per second and I want to do image processing. consequently i've just 10ms left for that. ) How can I process this huge amount of data faster (1.6mb*30 = 48mb/sec)? Since i load single images i dont know if its somehow possible to have a stream of data ... any comments?
2) I need to access the bitmap data of the image. Therefore i use the the LockBits method to receive the BitmapData. What I found very strange is that this method needs huge amount of time (20 - 100ms). This sounds very unreasonable to me since the data should already be in memory and all i want is a nice pointer to the data. The code I use is:
m_pBmSource->LockBits(&Rect(0,0,m_pBmSource->GetWidth(),m_pBmSource->GetHeight()),ImageLockModeRead | ImageLockModeWrite,PixelFormat24bppRGB,&m_pBmDataSource);
where m_pBmSource is the pointer to a Bitmap.
if you need more information to be able to help please let me know.
Many thanks
micheal
|
|
|
|
|
I can center text horizontally in a CEdit control,
but I can't figure out how to center text vertically
in a CEdit control. Any ideas?
Please, any response any one can give me will be
greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
DanYELL wrote:
Any ideas?
Add the ES_MULTILINE and ES_CENTER styles to the edit control. Now try the following:
m_edit.SetWindowText("H\r\ne\r\nl\r\nl\r\no\r\nW\r\no\r\nr\r\nl\r\nd\r\n!");
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|