|
Can you provide a sample code?
|
|
|
|
|
When I make any changes in a cell, it only saves the change when I push enter otherwise, change doesn't apply to mdb. What I want to do is to save this change whenever user input a value. how can i acheve this?
Regards,
Shin
|
|
|
|
|
Simply, use the method of your class (recordset) like SetRecordsetValue or other(depends on the class you use).
The most important mistake - you use class DataGrid to set changes, but it is incorrect. You must use directly class Recordset-based.
|
|
|
|
|
Yes,
I just want to get the event where I can save the record.
Sorry to make you confused.
Regards,
Shin
|
|
|
|
|
I have an SDI with a listview.
Is there any way to add another window to the mainframe, besides use of controlbars? I want another window next to the listview.
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
you will probably have to use Splitter windows
or use formview and place mulitple controls
|
|
|
|
|
I have an MFC Win32 client application that needs to generate PDF
files. The easiest way to do it is to have our customers purchase and
install Adobe Acrobat, and then our program will use the "Adobe PDF" printer
driver to output our text to PDF files.
From any application like Notepad, Word, Excel, using the Adobe PDF writer
works fine when I do File\Print, click "Print to File", uncheck the printer
property of downloading fonts to printer--my PDF file is created fine.
I need to do this from C++. The user is not going to use File\Print in our
app, we need to convert files as we go.
Something is not working in my code which I've pasted below. I'm using OpenPrinter
to open the "Adobe PDF" printer (return code is good), I call StartDocPrinter setting
my output file name to "D:\temp\test.pdf" and set the datatype either to RAW or NULL,
same result occurs: a test.pdf file is created, but it is pure text "this is a test"
instead of PDF content.
Anyone see what I am doing wrong? It appears to me that I need another code for
pDatatype. Or should I not be using these OS calls for a printer driver?
#include <winspool.h>
...
BOOL PrintStringDirect( LPCSTR Str, LPTSTR PrinterName, LPSTR DeviceName )
{
BOOL bRet = FALSE;
HANDLE hPrinter;
if ( OpenPrinter( PrinterName, &hPrinter, NULL ) )
{
DOC_INFO_1 doc_info = {0};
doc_info.pDocName = "Test Document";
doc_info.pOutputFile = DeviceName;
//doc_info.pDatatype = (LPTSTR) NULL;
doc_info.pDatatype = "raw";
DWORD jobid = StartDocPrinter( hPrinter, 1, (LPBYTE)&doc_info );
if ( jobid != 0 )
{
DWORD written;
DWORD dwNumBytes = lstrlen( Str );
WritePrinter( hPrinter, (void*) Str,
dwNumBytes, &written );
if ( written == dwNumBytes )
bRet = TRUE;
}
EndDocPrinter(hPrinter);
ClosePrinter(hPrinter);
}
return bRet;
}
PrintStringDirect("This is a test", "Adobe PDF", "D:\\temp\\test.pdf");
|
|
|
|
|
You should be creating the print job in exactly the same way as you would for a normal printer, but pass a filename through in the DOCINFO object so its written to a file instead.
If your doing this in MFC, this article of mine should be of help.
Setting default printer in MFC[^]
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Roger Allen wrote:
You should be creating the print job in exactly the same way as you would for a normal printer, but pass a filename through in the DOCINFO object so its written to a file instead.
Hmmm...I thought I was already doing what you said here:
DOC_INFO_1 doc_info = {0};
doc_info.pDocName = "Test Document";
doc_info.pOutputFile = DeviceName;
//doc_info.pDatatype = (LPTSTR) NULL;
doc_info.pDatatype = "raw";
DWORD jobid = StartDocPrinter( hPrinter, 1, (LPBYTE)&doc_info );
where DeviceName = "D:\\Temp\\test.pdf"
|
|
|
|
|
Roger,
Never mind my previous question to you, now I know what you
mean. Use a CDC, output the data to a print driver using that,
set DOCINFO as you described. You are correct, I tried this
and it works.
Thanks very much for your reply and all the sample code.
// Richard
|
|
|
|
|
In my program I'm using #import INPClnt.ocx"
and then using SMART pointers to create the object
i.e., INPCLNTLib::_DINPClntPtr inpc(__uuidof(_DINPClnt));
I have registered the OCX using regsvr32.
It is throwing exception saying "Class not Registered".
Could anyone help me out?
|
|
|
|
|
I am creating a CDHtmlDialog that is not going to be the size of the rendered HTML in all cases (i.e. it could be much larger than the HTML I am dynamically placing in it). I want to resize the dialog to be approximately the size of the rendered HTML.
I do have a control at the bottom of the dialog, and my thought is: if I could get the control's window position, I could resize the dialog accordingly. Unfortunately, I haven't the foggiest of how to do this.
Any ideas?
|
|
|
|
|
I want to have a recordset with bi-directional scrolling,
but when I connected to my database like following:
>CString strConnection=_T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=module.mdb");
>if(m_db.Open(strConnection))
>{
> m_rec=CADORecordset(&m_db);
> if(m_rec.Open(_T("main"), CADORecordset::openTable))
> MessageBox("Table 'main' is opened ");
>}
following operation:
>m_rec.MoveFirst();
has no effect(does not works).
But using class CRecordset it works:
>m_rec.Open("SELECT * FROM main", CRecordset::dynaset);
What a mistake I made using CADORecordset?
Thanks in advance,
bilas.
mailto:: keeper_@km.ru
|
|
|
|
|
bilas wrote:
What a mistake I made using CADORecordset?
Do you mean CDaoRecordSet?
Debbie
Debbie
|
|
|
|
|
NO, I mean exactly CADORecordset. This class I've found on this site.
|
|
|
|
|
OK, sorry, it's not a class I'm familiar with then.
Debbie
|
|
|
|
|
Hello
I've been having a problem (using vs6 on xp).
I use winsock (both 2.2 and 1.1 the same problem).
When i send from a client to a server a message it is printed ok.
However ,when i reply from the server to the client i get some kind of
unclear gibrish.
Any ideas ?
Thanks
|
|
|
|
|
Yep you are right! But I don't have an answer.
I send a DELE command to a sntp server and it sends back junk.
I have notified the Apache Foundation about it and they have a open issue.
Please let me know if you find a answer.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
I am not using apache and the commands are send() and recv() but thanks anyway
|
|
|
|
|
I have the same problem.
I have an idea but I am trying to implement it.
create an array of pointers to clientsocket in the serversocket.
when a client connects in OnAccept create a clientsocket dynamically and add its pointer to array.
now when serversocket.clients[i].Send(...);
oops it is not working
i have a question here
do we have to make client listen to server also.
if u get it right please, send as attachment to my email
vsrinu26f@yahoo.com
|
|
|
|
|
can anybody please give me the list of
STATPROPSTG.propid
for example, PIDSI_SUBJECT, PIDSI_KEYWORDS, PIDSI_TITLE and so on..
I only know some of them but not all.
and is there any different
thanks you
|
|
|
|
|
Try these:
{"Title", PIDSI_TITLE}, // VT_LPSTR
{"Subject", PIDSI_SUBJECT}, // ...
{"Author", PIDSI_AUTHOR},
{"Keywords", PIDSI_KEYWORDS},
{"Comments", PIDSI_COMMENTS},
{"Template", PIDSI_TEMPLATE},
{"LastAuthor", PIDSI_LASTAUTHOR},
{"Revision Number", PIDSI_REVNUMBER},
{"Edit Time", PIDSI_EDITTIME}, // VT_FILENAME (UTC)
{"Last printed", PIDSI_LASTPRINTED}, // ...
{"Last Saved", PIDSI_LASTSAVE_DTM},
{"Page Count", PIDSI_PAGECOUNT}, // VT_I4
{"Word Count", PIDSI_WORDCOUNT}, // ...
{"Char Count", PIDSI_CHARCOUNT},
{"Thumpnail", PIDSI_THUMBNAIL}, // VT_CF
{"AppName", PIDSI_APPNAME}, // VT_LPSTR
{"Doc Security", PIDSI_DOC_SECURITY}, // VT_I4
Art
|
|
|
|
|
Hi,
I'm writing a utility application which needs to send and receive messages to/from a plugin I've written for another application, but I'm not sure where to start looking...
The plugin is developed using an architecture derived from COM (apparently) and I've got this up and running and talking to its host app just fine. My own utility application is also up and running and working fine. Now I need to send messages back and forth between the two.
I don't think I can use custom Window messages as the plugin doesn't have a window it just runs inside the host app. I'm investigating network related stuff but I'm guessing this is overcomplicating things.
Any advice would be greatly appreciated.
Cheers,
Simon
|
|
|
|
|
If they are on the same machine, look up WM_COPYDATA in MSDN.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
srev wrote:
I don't think I can use custom Window messages as the plugin doesn't have a window it just runs inside the host app.
You can also post messages to a thread[^].
But if you're using COM, shouldn't you be using events?
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.4 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|