|
i try to use 2 table in 1 a software..I can view but i can not update both table...Recordset is read only error pops up..... After some readings i found out that i must use 2 different class for the both table...But i do know how.....????
|
|
|
|
|
Are you using MFC? The class wizard might help - for each table you want to work with, open class wizard (ctrl+w), choose Add Class (new) and select either CRecordset or CDaoRecordset as the base. It will then prompt you for tables etc. This way you can make a separate class for each table in the database - they should default to dynasets so you can update them.
You don't say what your goal is in working with the tables, so its hard for me to say if the MFC classes are what you need, but they are usually good for simple data updates etc.
|
|
|
|
|
thanx very much for the immediate reply......
I think I got it...
Thanxs to you.....
avisavc
|
|
|
|
|
Oooops.....Actully i wanna to read and write two recordset from two different table in the main window...The software is using ODBC.After i create class for each window wat do i do next...
help me.....
|
|
|
|
|
Ah - well, I'd say maybe you want to get the two recordsets working first, before designing the form/dialog that will go with them. I wouldn't go with a CRecordView in this case.
Once you get the hang of moving around the recordsets, you should be able to set up a dialog to do what you want with both recordsets represented, and you may end up with better control over things, even if at first you seem to be losing some built in functionality in the relation of the CRecordView to the CRecordset.
Always think carefully about what you want though - if there doesn't seem to be a class that represents your needs, examine your needs - especially if you are new to database design.
And thanks for the thanks
|
|
|
|
|
I coded a software.. I am having problem in the print preview... The allignment runs when i set to different printer... When i use HP1200 the alignment is correct.. When i use BJC265SP the alligment runs.. Half of the document in the print preview missing from the page.
Thanx
|
|
|
|
|
Are you printing by getting the size of the printer DC and factoring everying to that ? Otherwise it sounds like you are printing to the right DPI for the HP, but the BJC has twice the DPI.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
So how to overcome that... ???Plz help me...
|
|
|
|
|
In OnPrint get the resolution by calling
long PrintAreaHorz = GetDeviceCaps(pDC->m_hDC, HORZRES);
long PrintAreaVert = GetDeviceCaps(pDC->m_hDC, VERTRES);
then use these values to scale your page.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Could anyone tell me what job the follow project files do? thanx
.dsw
.dsp
.opt
.ncb
|
|
|
|
|
.dsp: Project file, similar to a makefile.
.dsw: Workspace - collection of projects.
.opt: Debugging options.
.ncb: IntelliSense data. This often gets corrupted, and can safely be deleted since the IDE will automagically rebuild it.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
I have custom the print mechanism as the MFC function OnFilePrint.
But when I print the several copies of my document(one page only).
there always are additional pages.
my code like this:
startdoc(docinfo);
for (int i = 0; i < pInfo->m_pPD->GetCopies(); i++) {
startpage();
//print my document;
endpage();
}
enddoc();
please help me
|
|
|
|
|
Hello,
I'm new in c++ and I would like to write a program that read a JPG file and display the image in a window, but I don't know how to do the programming. Please help me.
Thank you.
Thiago Jackiw
|
|
|
|
|
You can use GDI+ to load a bitmap, or use a library like paintlib ( www.paintlib.de ). I'd recommend GDI+, just search for my surname for articles by author and you'll find all the info you need here.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
You are so right,the screwy code would help
greatestCommonDenominator()
{
int gcd, same, hold1, hold2;
if(iNumerator < iDenominator){
for(gcd=1;gcd
|
|
|
|
|
greatestCommonDenominator()
{
int gcd, same, hold1, hold2;
if(iNumerator < iDenominator){
for(gcd=1;gcd hold1 = iDenominator / gcd;
^^^^^^^^^^ what's up with this ? Is a bit missing in the middle ? This won't compile because the for loop has no closing bracket. Does the for loop have a ; at the end of it ? If so, it won't work either.
Also, if you want the for loop to take into account more than one line, they need to also be enclosed in {}.
hold2 = iNumerator / gcd;
if(hold1 == hold2)
same = hold1;
}
Here is a gcd function
int gcd(int m, int n)
{
if (m==0) return n;
else return gcd( n%m, m);
}
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Your code sample looks garbled, please put it between <pre> and </pre> tags and use < for the < sign and > for >
|
|
|
|
|
Just as a guess, the division looks suspect. You are dividing two integers, which returns an integer (throwing away the remainder), and that might not be what you want.
You are also comparing (iDenominator/gcd) == (iNumerator/gcd) which (assuming you change those variables to floating-point) is true only if iDenominator == iNumerator, so check your algorithm again.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
int GCD(int x, int y)
{
//Swap if x < y
if(x < y)
{
int t = x;
x = y;
y = t;
}
while(x%y)
{
int r = x%y;
x =y;
y = r;
}
return y;
}
void (*p[10]) (void (*)());
|
|
|
|
|
How do I use WMode to set transparent effect with Flash ActiveX control.
Thank!
|
|
|
|
|
I can't for the life of me figure out the simplest of problems. I am trying to capture the greatest common denominator of two integers and can't seem to get more than garbage for the output. Any algorithmic nudge in the right direction would be most appreciated.
|
|
|
|
|
If the code u have written is available, it would be easy to check why is it giving wrong output.
void (*p[10]) (void (*)());
|
|
|
|
|
int GCD(int x, int y)
{
//Swap if x < y
if(x < y)
{
int t = x;
x = y;
y = t;
}
while(x%y)
{
int r = x%y;
x =y;
y = r;
}
return y;
}
void (*p[10]) (void (*)());
|
|
|
|
|
I have an application, prog B, that starts minimized.
Another program, let's say winamp, currently has the focus.
My program - prog B should be able to retrieve the .exe name based on whichever application that currently has the focus, in this case, winamp.
I'm not sure how to go about and tackle this problem. Can somebody please help me out?
Environment - Windows 2000
Thanks in advance,
|
|
|
|
|
The GetWindowModuleFileName function retrieves the full path and file name of the module associated with the specified window handle.
|
|
|
|