|
I recommend CxImage (@codeproject), searching www.sourceforge, or trying a comercial library.
Any image format they do not recogise you'll have to convert you self.
Good Luck!
INTP
|
|
|
|
|
I hope CxImage won't revognize this format and anyway i will try it again, but i don't think it can do it...
If I've to code it myself...how can I start doing it....
|
|
|
|
|
I am sure CxImage will not recognise that particular format, I don't even know what language thats in.
I searched for "datatype: lsb_msb" and found 1 reply, refering to Princeton Instruments ".SPE" Image file format, in the "Image-Pro User's Group Mailing List Archive".
The general idea expressed was:
Given a program that can open the image file (for display/edit), you can then export it via the clipboard as a .bmp.
I beleive the software he was refering to was "Princeton Instruments WinView ... for digital imaging"
INTP
|
|
|
|
|
Hi John,
I've tried opening the files in Princeton's Winview software, but it is opening it and is giving an error as 'unknown file format'. I just want to know whether we can open an image file in C++, if we know the image header information.
Anyway these people are also developing their programs in c++ like languages....then how r they able to process these new file formats. Lemme know if you know anything about this and I appreciate your help
Pavan.
|
|
|
|
|
You can open up any file, but C++, like any other language, knows nothing about file headers. If you have the file fomat documentation then you should have no problem reading it and converting it to a bitmap; accept for all that code writing. Well maybe some trouble, depending on the type of data stored in the file.
Good Luck!
INTP
|
|
|
|
|
If you know, can you help me by giving me an outline on this, like how to proceed in programming, for reading the file and if its header information is useful in anyway in programming and how to save a file in a known format.
Till now I dealt only with text files for most of my programming stuff.
Thanks,
Pavan.
|
|
|
|
|
Help me about the above Topic.
Suman Kumar M V
|
|
|
|
|
Suman,
you may want to put in something a little more specific. I think most people won't answer because they have no idea what you actually need. What do you want to know about USB interface in VC++?
Jubjub
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
Im writing a front end for a console prog in VCPP and am having a hell of a time trying to pass params. For some reason whenever i use ShellExecute to pass params the programm receiving them interperates all params as a single param and fails (according to its log). If i use _execl it works perfectly only my app terminates for some odd reason.
Im a fairly experienced programmer and have just started out w/ windows programming. This is also my first windows app thatll serve a purposed btw
Heres the ShellExecute code that doesnt not pass the params correctly:
ShellExecute(NULL,
"Open",
"C:\\Program Files\\UT2004\\System\\ucc.exe",
"compress AS-Convoy.ut2",
NULL,
SW_SHOWNORMAL);
And heres the _execl that works but kills my app:
execl("C:\\Program Files\\UT2004\\System\\ucc.exe",
" compress",
"AS-Convoy.ut2",
NULL);
* note the space before " compress" if i leave out this space the called prog fails. ive tried the same thing w/ ShellExecute but it still fails.
If anyone has an idea about how i should go about getting ShellExecute to pass the params different or how i can stop _execl from killing my app id be very greatful.
Oi! Oi! Oi!
|
|
|
|
|
What results do you get with CreateProcess() ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have a problem passing a pointer by reference to a parsing function. The function prototype is:
void ReadNode(Node*& nodeToRead);
which basically reads a node description from a parsing stream, and allocates memory for the new node accordingly. The node is NULL in case of invalid node description.
I'm using this function to parse scene nodes. The SceneNode class derives from the Node (abstract base) class.
SceneNode* nodeToRead = NULL;
ReadNode(nodeToRead);
I'm getting the following error:
error C2664: 'Betelgeuse::Parser::ReadNode' : cannot convert parameter 1 from 'Betelgeuse::SceneNode *' to 'Betelgeuse::Node *& ' A reference that is not to 'const' cannot be bound to a non-lvalue
I get the same error when using a pointer to pointer instead.
I don't understand why it doesn't work. Any explanation and suggestion would be greatly appreciated.
Cheers, blackmesa.
|
|
|
|
|
One solution is a pointer to a pointer.
Post the code you mentioned that takes in **. Post the code that calls the function and the essential parts of the function too.
Kuphryn
|
|
|
|
|
What happens if you explicitly cast nodeToRead to a Node* ?
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 got the answer to my question in another forum.
Basically a temporary Node* is created from the SceneNode* when I pass it to ReadNode(). Problem is, a temporary cannot be bound to a non const reference.
Everything works fine if I downcast to a Node* before calling ReadNode(). I will stick to that solution for now, and will refine my design only if I end up overusing rtti.
Thanks for your responses.
Cheers, blackmesa.
|
|
|
|
|
I've little experience in procedural programming, but I want to have good knowledge with OOP. I've read some books and articles about OOP in VC++, but what I still don't know is how to communicate with objects from a main application in Visual C++. For example to send text with CSocket through internet. I would like to know how to communciate with CSocket so I can send text through a computernetwork. CSocket is just an example, but for example I could name other objectcomponents like Bluetooth or serialport, etc...
I hope you guys can help me, some good links is also ok!
Thanx and peace!
|
|
|
|
|
It all depends on design requirements such as the amount of the data, speed, reliability, etc.
Kuphryn
|
|
|
|
|
Thanx for your reaction, but I need a start . There must be a standard protocol in VC++ to communicate from the mainprogram with objects.
I've seen some simple chatapplications where they use pointers to send data. In the mainapp there is a pointer to a CSocket object and the CSoscket object has a pointer to CDocument for example. But what I'm interested in is there must be some kind of a rule so you can communicate with other objects. Maybe I want to build in a mp3-player in my app, wahtever. So I hope you proud Wizzkids can help me out
|
|
|
|
|
I have created a program using the doc/view architecture, and using CEditView as the view window. When you are typing something, and then save the document, the caret is moved back to the start of the text, and I want to know how to stop this from happening.
I have tried responding to the ON_FILE_SAVE message, and finding the position of the caret with pCaretPoint = CEditView->GetCaretPos() , then calling CDocument::OnFileSave() , and then using CEditView->SetCaretPos(pCaretPos) to set the caret position to its initial position, however I think the caret gets re-set after CDocument::OnFileSave() as this has no effect.
Any help is much appreciated
|
|
|
|
|
I created a resource only dll and have been trying to load it into my project without much luck. The code to load the dll essentially
HINSTANCE m_hinst;
m_hinst = LoadLibrary(name.dll);
Instead of a pointer to the dll, the return value is continually, 0x10000000.
Do I have some dll project settings incorrect, or am I doing something wrong?
|
|
|
|
|
if LoadLibrary() is returning 0x10000000, then 0x10000000 is the "pointer to your dll" aka the dll's load address.
Bikram Singh
I believe we should all pay our tax with a smile. I tried - but they wanted cash.
|
|
|
|
|
|
Any ideas? Is their any way to programmatically have a printer
already selected if you know the name of the printer you want to
print to?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
BOOL CMyApp::SetPrinterDevice(LPTSTR pszDeviceName)
{
HANDLE hPrinter;
if (OpenPrinter(pszDeviceName, &hPrinter, NULL) == FALSE)
return FALSE;
DWORD dwBytesReturned, dwBytesNeeded;
GetPrinter(hPrinter, 2, NULL, 0, &dwBytesNeeded);
PRINTER_INFO_2* p2 = (PRINTER_INFO_2*)GlobalAlloc(GPTR,
dwBytesNeeded);
if (GetPrinter(hPrinter, 2, (LPBYTE)p2, dwBytesNeeded,
&dwBytesReturned) == 0)
{
GlobalFree(p2);
ClosePrinter(hPrinter);
return FALSE;
}
ClosePrinter(hPrinter);
HGLOBAL hDevMode = GlobalAlloc(GHND, sizeof(*p2->pDevMode) +
p2->pDevMode->dmDriverExtra);
DEVMODE* pDevMode = (DEVMODE*)GlobalLock(hDevMode);
memcpy(pDevMode, p2->pDevMode, sizeof(*p2->pDevMode) +
p2->pDevMode->dmDriverExtra);
GlobalUnlock(hDevMode);
DWORD drvNameLen = _tcslen(p2->pDriverName);
DWORD ptrNameLen = _tcslen(p2->pPrinterName);
DWORD porNameLen = _tcslen(p2->pPortName);
DWORD devNameSize = sizeof(DEVNAMES) +
(ptrNameLen + porNameLen + drvNameLen + 3)*sizeof(TCHAR);
HGLOBAL hDevNames = GlobalAlloc(GHND, devNameSize);
DEVNAMES* pDevNames = (DEVNAMES*)GlobalLock(hDevNames);
pDevNames->wDriverOffset = sizeof(DEVNAMES)/sizeof(TCHAR);
memcpy((LPTSTR)pDevNames + pDevNames->wDriverOffset,
p2->pDriverName, drvNameLen*sizeof(TCHAR));
pDevNames->wDeviceOffset = (WORD)(pDevNames->wDriverOffset + drvNameLen + 1);
memcpy((LPTSTR)pDevNames + pDevNames->wDeviceOffset,
p2->pPrinterName, ptrNameLen*sizeof(TCHAR));
pDevNames->wOutputOffset = (WORD)(pDevNames->wDeviceOffset + ptrNameLen + 1);
memcpy((LPTSTR)pDevNames + pDevNames->wOutputOffset,
p2->pPortName, porNameLen*sizeof(TCHAR));
pDevNames->wDefault = 0;
GlobalUnlock(hDevNames);
GlobalFree(p2);
m_hDevMode = hDevMode;
m_hDevNames = hDevNames;
return TRUE;
}
Igor Green
http://www.grigsoft.com[^]
Compare It! + Synchronize It! : Files and folders comparison never was easier!
|
|
|
|
|
Hello
I have a question
I am trying to send mail with mapi
I have configured my outlook express and I have an account called TestProfile there.
So I load up mapi like this:
<br />
<br />
LHANDLE session;<br />
MapiMessage *mes;<br />
MapiRecipDesc from;<br />
char messId[512],mname[50],maddr[30],fsubj[50];<br />
HINSTANCE hMAPI;<br />
<br />
<br />
ULONG (PASCAL FAR *mSendMail)(ULONG, ULONG, MapiMessage*, FLAGS, ULONG);<br />
ULONG (PASCAL FAR *mLogoff)(LHANDLE, ULONG, FLAGS, ULONG);<br />
ULONG (PASCAL FAR *mLogon)(ULONG, LPTSTR, LPTSTR, FLAGS, ULONG, LPLHANDLE);<br />
ULONG (PASCAL FAR *mFindNext)(LHANDLE, ULONG, LPTSTR, LPTSTR, FLAGS, ULONG, LPTSTR);<br />
ULONG (PASCAL FAR *mReadMail)(LHANDLE, ULONG, LPTSTR, FLAGS, ULONG, lpMapiMessage FAR *);<br />
ULONG (PASCAL FAR *mFreeBuffer)(LPVOID);<br />
<br />
<br />
hMAPI=LoadLibrary("MAPI32.DLL");<br />
if (hMAPI==NULL)<br />
{<br />
MessageBox(0,"nu exista MAPI.DLL ","ciudat",MB_OK);<br />
}<br />
(FARPROC &)mSendMail=GetProcAddress(hMAPI, "MAPISendMail");<br />
<br />
MessageBox(0,"am ajuns aici","a",MB_OK);<br />
<br />
(FARPROC &)mLogon=GetProcAddress(hMAPI, "MAPILogon");<br />
(FARPROC &)mLogoff=GetProcAddress(hMAPI, "MAPILogoff");<br />
(FARPROC &)mFindNext=GetProcAddress(hMAPI, "MAPIFindNext");<br />
(FARPROC &)mReadMail=GetProcAddress(hMAPI, "MAPIReadMail");<br />
(FARPROC &)mFreeBuffer=GetProcAddress(hMAPI, "MAPIFreeBuffer");<br />
<br />
<br />
if (mLogon==NULL)<br />
{<br />
MessageBox(0,"nu exista functia mlogon ","ciudat",MB_OK);<br />
}<br />
<br />
then I logon to mapi because I understand that you can't send mail if you don't correct me if I am wrong
<br />
<br />
ULONG a;<br />
<br />
a=mLogon(NULL,NULL,NULL,MAPI_NEW_SESSION ,NULL,&session);<br />
switch(a)<br />
{<br />
case MAPI_E_FAILURE:<br />
<br />
MessageBox(0,"One or more unspecified errors occurred during logon. No session handle was returned.","a",MB_OK); <br />
break;<br />
case MAPI_E_INSUFFICIENT_MEMORY: <br />
MessageBox(0,"There was insufficient memory to proceed. No session handle was returned. ","a",MB_OK);<br />
break;<br />
case MAPI_E_LOGIN_FAILURE:<br />
MessageBox(0,"There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed. No session handle was returned. ","a",MB_OK);<br />
break;<br />
<br />
case MAPI_E_TOO_MANY_SESSIONS:<br />
MessageBox(0,"The user had too many sessions open simultaneously. No session handle was returned. ","a",MB_OK);<br />
break;<br />
case MAPI_E_USER_ABORT:<br />
<br />
MessageBox(0,"The user canceled the logon dialog box. No session handle was returned. ","a",MB_OK);<br />
break;<br />
case SUCCESS_SUCCESS:<br />
MessageBox(0,"a mers?!?","ciudat",MB_OK);<br />
break;<br />
<br />
default:<br />
{<br />
MessageBox(0,"m-am dat reaku ","ciudat",MB_OK);<br />
}<br />
<br />
}<br />
<br />
now here is the problem I always end up in the default wich means it is none of the above
This started after I made that outlook account TestProfile
I made it because I read a article on codeproject.com about mapi and it said that I should have one like that and I made one but I still can't send mail not even with the program from that article(compiled source code)
Before I did this MAPI used to log on but I never got to send any mail
It always prompted me if I wanted my mail to be send and I always said yes but I never got to send any mail.
Maby I did something wrong I don't know here is how tryed to send it:
<br />
<br />
mes->ulReserved=0;<br />
mes->lpszSubject=fsubj;<br />
mes->lpszNoteText="bla bla bal";<br />
mes->lpszMessageType=NULL;<br />
mes->lpszDateReceived=NULL;<br />
mes->lpszConversationID=NULL;<br />
mes->flFlags=MAPI_SENT;<br />
mes->lpOriginator->ulReserved=0;<br />
mes->lpOriginator->ulRecipClass=MAPI_ORIG;<br />
mes->lpOriginator->lpszName=mes->lpRecips->lpszName;<br />
mes->lpOriginator->lpszAddress=mes->lpRecips->lpszAddress;<br />
mes->nRecipCount=1;<br />
mes->lpRecips->ulReserved=0;<br />
mes->lpRecips->ulRecipClass=MAPI_TO;<br />
mes->lpRecips->lpszName=mname;<br />
mes->lpRecips->lpszAddress=maddr;<br />
mes->nFileCount=1;<br />
mes->lpFiles=(MapiFileDesc *)malloc(sizeof(MapiFileDesc));<br />
memset(mes->lpFiles, 0, sizeof(MapiFileDesc));<br />
mes->lpFiles->ulReserved=0;<br />
mes->lpFiles->flFlags=NULL;<br />
mes->lpFiles->nPosition=-1;<br />
mes->lpFiles->lpszPathName="D:\a.txt";<br />
mes->lpFiles->lpszFileName="a.txt";<br />
mes->lpFiles->lpFileType=NULL;<br />
mSendMail(session, NULL, mes, NULL, NULL);<br />
<br />
I am running win xp
please help out
thank you for your time
oh, and here is the name of that app I took from codeproject and it did not work for me to send mail with it :
Sending Email using MAPI - A COM DLL
By Aisha Ikram
|
|
|
|
|
Have you tried scaling the code down to something a wee bit smaller? What does the following produce:
HINSTANCE hMAPIInstance = LoadLibrary("MAPI32.DLL");
LPMAPILOGON lpMAPILogon = (LPMAPILOGON) GetProcAddress(hMAPIInstance, "MAPILogon");
LPMAPIRESOLVENAME lpMAPIResolveName = (LPMAPIRESOLVENAME) GetProcAddress(hMAPIInstance, "MAPIResolveName");
LPMAPISENDMAIL lpMAPISendMail = (LPMAPISENDMAIL) GetProcAddress(hMAPIInstance, "MAPISendMail");
LHANDLE lSession;
UINT uResult = (*lpMAPILogon)((UINT) m_hWnd, NULL, NULL, 0, 0, &lSession);
MapiRecipDesc *prMapiRecipient;
uResult = (*lpMAPIResolveName)(lSession, (UINT) m_hWnd, (LPSTR) lpszRecipient, 0, 0, prMapiRecipient);
lpMapiRecipDesc->ulReserved = 0;
lpMapiRecipDesc->ulRecipClass = MAPI_TO;
MapiMessage MapiMsg = {0};
MapiMsg.lpszSubject = (LPSTR) lpszSubject;
MapiMsg.lpszNoteText = (LPSTR) lpszBody;
MapiMsg.nRecipCount = 1;
MapiMsg.lpRecips = prMapiRecipient;
uResult = (*lpMAPISendMail)(lSession, (UINT) m_hWnd, &MapiMsg, 0, 0);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|