|
Hai....how can i use C++ to save tiff image to raw data>?
|
|
|
|
|
Look at cxImage library in Codeproject
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Maybe a simple question but when you open a database (SQL2000) in MFC CRecordset in mode dymanic and then sort the database by any column(s), why does the database (recordset) become "READ ONLY". It's open for read/write but as soon as you start sorting the database, you can't write/update anymore.
I am trying a workaround with stored procedures but if that fails, I will have to give the sorts.
Anybody out there can help me?
Thanks,
craig christensen
|
|
|
|
|
HI,
How can i manipulate Registry.
Any sample by Example.
thanx
|
|
|
|
|
Check the following sample function for creating & setting a registry key.
You can use APIs RegOpenKeyEx, RegQueryMultipleValues, RegQueryValue defined in winreg.h to read the values from registry keys
BOOL CFTPDlg::RegisterFTPProfile(FTPProfile LocalCopyFTPProfile)
{
BOOL bRetVal;
HKEY hkResult;
CString strTmp;
unsigned char *lpBuf;
int n;
//Preapre the complete Path Name for selected profile.
strTmp = g_strProfileRegPath + CString("\\");
strTmp += (LPCTSTR)LocalCopyFTPProfile.strProfileName ;
bRetVal=RegCreateKeyEx(HKEY_LOCAL_MACHINE,
(LPCTSTR)strTmp,
NULL,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,
NULL,
&hkResult,
NULL);
if (bRetVal==ERROR_SUCCESS)
{
n=LocalCopyFTPProfile.strHostAdd.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf,(LPCTSTR)LocalCopyFTPProfile.strHostAdd);
bRetVal=RegSetValueEx(hkResult,
"HOST_ADD",
NULL,
REG_SZ,
lpBuf,
n);
free((void *)lpBuf);
n=LocalCopyFTPProfile.strLoginID.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf,(LPCTSTR)LocalCopyFTPProfile.strLoginID);
bRetVal=RegSetValueEx(hkResult,
"LOGINID",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);
n=LocalCopyFTPProfile.strPassword.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf, (LPCTSTR)LocalCopyFTPProfile.strPassword);
bRetVal=RegSetValueEx(hkResult,
"PASSWORD",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);
n=LocalCopyFTPProfile.strHostPath.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf,(LPCTSTR)LocalCopyFTPProfile.strHostPath);
bRetVal=RegSetValueEx(hkResult,
"HOST_PATH",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);
n=LocalCopyFTPProfile.strLocalPath.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf , (LPCTSTR)LocalCopyFTPProfile.strLocalPath);
bRetVal=RegSetValueEx(hkResult,
"LOCAL_PATH",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);
n=LocalCopyFTPProfile.strSleepTime.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf , (LPCTSTR)LocalCopyFTPProfile.strSleepTime);
bRetVal=RegSetValueEx(hkResult,
"SLEEP_TIME",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);
n=LocalCopyFTPProfile.strDescription.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf , (LPCTSTR)LocalCopyFTPProfile.strDescription);
bRetVal=RegSetValueEx(hkResult,
"DESCRIPTION",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);
RegCloseKey(hkResult);
return TRUE;
}
return FALSE;
}
|
|
|
|
|
THe following Code giving the Error
that is failing to Open the Key .. n givign mine message box written in else portion..
Keys e created in registry using ur above reply example code
plz help abut open n Query the keys
BOOL bRetVal;
HKEY hkResult;
CString strTmp = "Software\\NDT";
char *lpBuf;
int n;
bRetVal=RegOpenKeyEx( HKEY_LOCAL_MACHINE ,
(LPCTSTR)strTmp,0,0,&hkResult);
if (bRetVal==ERROR_SUCCESS)
{
CString id = "UserName";
n=id.GetLength()+1;
lpBuf = (char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf,(LPCTSTR)id);
LPSTR str;
long j;
bRetVal= RegQueryValue(hkResult, lpBuf, str , &j);
if (bRetVal==ERROR_SUCCESS)
{
AfxMessageBox (" Success");
}
else
{
AfxMessageBox (" Not read the key");
}
}
else
{
AfxMessageBox (" Not open the key");
}
|
|
|
|
|
Check the help documentation for API RegOpenKeyEx. You need to specify the access level you desire while opening a registry key. You haven't given that. (Check the help documentaion for 4 the para of the API RegOpenKeyEx)
That will solve your problem;)
|
|
|
|
|
there`s plenty of good article here. But I forgot where , may be you can find it at system
|
|
|
|
|
Hi,all
In an application I currently involved in. when user enter some data, the app will send the data to specified mailbox. we want the app send mail without any user interactive (user may need to enter his/her email address when install the app)
I had try MAPI, but it is proven that MAPI need a MAPI Client (eg. Outlook) be installed and configured before it can work. in the real world, we can't assurance that every PC can fit this requirement.
I had also try some raw socket code to send mail via smtp server, but eventually i found most SMTP server need user authentication. we don't want user enter such info as it is too advance
so i need help.
|
|
|
|
|
>> send mail without smtp server?
That might be like trying to breath without air
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
ispring wrote:
how to send mail without smtp server?
Write it on a piece of paper, place it in an envelope, address it, put a stamp on it, and put it in a mailbox
Humour aside...
If you really can't use MAPI, then you'll need to use raw sockets and connect directly to the SMTP server which holds the recipient's account. You shouldn't need to authenticate yourself to a particular server if you are sending mail to a user whose account is on that server.
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"
|
|
|
|
|
Ryan, thank you for you reply.
I have tryed your approach, that is, connect to the target smtp server directly, but the server require user authentication too. so it doesn't work.
it seem that the only way to send email without smtp server is implement a smtp server in my app.
|
|
|
|
|
then, send the authentication to the server (requires Username and Password)... be sure to Encode them...
|
|
|
|
|
ok, then, how to send the authentication to the server
I cannot find such a command in the SMTP command set.
SMTP Commands:
HELO (Hello) <br />
MAIL (Mail) <br />
RCPT (Recipient) <br />
DATA (Data) <br />
SEND (Send) <br />
SOML (Send or mail) <br />
SAML (Send and mail) <br />
RSET (Reset) <br />
VRFY (Verify) <br />
EXPN (Expand) <br />
<br />
HELP (Help) <br />
NOOP (Noop) <br />
QUIT (Quit) <br />
TURN (Turn)
I know there must be a way there, but I can't find it
|
|
|
|
|
|
Unless the client is able to successfully send e-mail, there's no way for you to do it programmatically. Something has to be in place that works.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I want my Program to take SnapShots while it's running without Pressing any Keys on the Keyboard. What Methods/Functions will I use?! please provide sample codes... thanks!!!
|
|
|
|
|
Use DirectDraw, SnapShot PrimarySurface.
|
|
|
|
|
Will it be able to Capture the Contents of my Screen?! pls, Help... I badly need this Information... Thanks!!!
|
|
|
|
|
Of course you can capture full contents of your screen, or a rectangle on the screen. This is the best solution for your purpose. There is lots of samples on the internet about this matter.
Create DirectDraw Primary Surface
Lock The surface and get the surface pointer
Create a bitmap file
Copy memory from surface pointer to file.
(You have to take into account screen pixel depth (16,24,32 bit) for bitmap, these should be same bit depth)
|
|
|
|
|
I think, this Info is for AVI or Video purpose... Am I right?! I only want to Get a SnapShot of the Whole Screen(like Pressing "PrtScr" Key)... Anyway, Thanks for the Info...
|
|
|
|
|
hain bussy i told you last day whole procedure ,u ra enot pressing the key on keyborad for taking snapdhot,this work will done by api for you
pls do take note for this
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
please tell me the whole procedure... i wasn't able to view the Thread that I made 2 days ago...
|
|
|
|
|
ok, i already got it!!! thanks alot!!!
|
|
|
|
|
How will I be able to Save it on a Bitmap/JPEG File?! thanks alot!!! AWESOME!!!
|
|
|
|
|