|
Ah, that's perfect, thanks. Would've preferred the easier WinForm methods of having it in the solution, but not complaining
|
|
|
|
|
Hello,
I'm communicating with a logic analyzer (HP 1660A) over RS232. I issue a command which tells the analyzer to print screen its display and send it over to the controller (my pc) through serial communication. I'm saving the result (which is usually abut 25kB) to my computer and I would like to view it as a TIFF or other format. The problem is that the response from the analyzer comes in PCL format, therefore suitable to be sent to a printer and printed directly, but not to be opened as an image. I have tried a few PCL to image converters to do the job, I found one which does it properly, however I've used the trial version and I am reluctant to purchase it. I've given you the background of my labour. I would appreciate any kind of help, a reference to the commands in pcl 1 and what should I do in order to extract the data and format it properly from the PCL file. I have no experience with PCL and image processing whatsoever, so please, give me a hand here. Thank you.
P.S. I've obtained the PCL file from the analyzer, both in C# and matlab... I have one slight problem in C# with the serial port control, some images have some uninterpreted characters in the image, when using the above converters. I say all these because I need an algorithm or some indications, no matter the programming language, so please feel free to post.
|
|
|
|
|
There are some commercial tools around to do this such as PCLTool SDK but I've never used them. (I resorted to photographing my scope's display to get images). Presumably this is the only format you can get from it?
|
|
|
|
|
I've tried using PCLReader, which is freeware, but it has a problem in that it strips about 3 characters from the right hand side of the image (I mean the entire right portion, for a 3 character width). The same issue I have with PclToImage from Oak. The only one that does the job properly is EscapeE from RedTitan, but, unfortunately, this is not free and I work on a school project.
The device accepts commands and queries. When I use a command, I can save the image in TIFF format on a floppy disk, but I am not to use the floppy too often, because it is the only storage medium on the analyzer, and also the boot device and it will break down very fast. So I must use a query, to send the image through RS232 to the pc and the only output type is PCL. Thank you.
|
|
|
|
|
I would like to open a URL file("http:\\A\\file.ext"), but I would like to find out if the file is actually there before opening it using ShellExecute. The error codes don't help much, because if the file isn't there, it would still open the browser, but won't display contents, but the error code will still succeed. I tried using ShellExecute( "Find" ) to find out if the file is there before I open it, but I think I may have used it wrong because it never finds it based on the err code (5) that I keep getting. Anybody have an idea of how I can do this ?
Thanks
sft
|
|
|
|
|
Is that file on your local file system? If so, then simply try using FileExists[^] to check if it is there before trying to open it in your browser.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hello,
no, its a web file. I just want to be able to open the file successfully...ShellExecute("open","http:\\www.gooogle.com"..) will return as successful even though it might not be there or no contents displayed.. I would like to check the valididty of the URL before opening it in other words.
Thanks
sft
|
|
|
|
|
I believe ShellExecute itself will only report you if it could run the specified/associated application/command, and since you specified something starting with http:\\, it will run the associated browser and feed this to it, and since it CAN run the browser it will say "success", it doesn't care what the browser actually does with the URL. I doubt you can check if the URL is valid or not by using ShellExecute, you will have to either try finding some library or class or such that checks if an URL is valid or not for you, or you will have to do the check yourself. Of course i could be wrong...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
|
INT WSAInstallServiceClass(
__in LPWSASERVICECLASSINFO lpServiceClassInfo
);
typedef struct _WSAServiceClassInfo {
LPGUID lpServiceClassId;
LPTSTR lpszServiceClassName;
DWORD dwCount; LPWSANSCLASSINFO lpClassInfos;
} WSASERVICECLASSINFO, *PWSASERVICECLASSINFOW;
Just a collection of WSANSCLASSINFO ?
And the programmer needs to keep the array of WSANSCLASSINFO consistant
(hold some common attributes that make sense to the service class)?
It seems that the consistency is not promised, in another word, the inconsistency can't be detected
mechanically.
============================================
Here is a sample in the book,
the content of the array aNameSpaceClassInfo seems arbitrary, does it?
WSASERVICECLASSINFO sci;
WSANSCLASSINFO aNameSpaceClassInfo[4];
DWORD dwSapId = 200,
dwUdpPort = 5150,
dwZero = 0;
int ret;
memset(&sci, 0, sizeof(sci));
SET_NETWARE_SVCID(&sci.lpServiceClassId, dwSapId);
sci.lpszServiceClassName = (LPSTR)"Widget Server Class";
sci.dwCount = 4;
sci.lpClassInfos = aNameSpaceClassInfo;
memset(aNameSpaceClassInfo, 0, sizeof(WSANSCLASSINFO) * 4);
aNameSpaceClassInfo[0].lpszName = SERVICE_TYPE_VALUE_CONN;
aNameSpaceClassInfo[0].dwNameSpace = NS_NTDS;
aNameSpaceClassInfo[0].dwValueType = REG_DWORD;
aNameSpaceClassInfo[0].dwValueSize = sizeof(DWORD);
aNameSpaceClassInfo[0].lpValue = &dwZero;
aNameSpaceClassInfo[1].lpszName = SERVICE_TYPE_VALUE_UDPPORT;
aNameSpaceClassInfo[1].dwNameSpace = NS_NTDS;
aNameSpaceClassInfo[1].dwValueType = REG_DWORD;
aNameSpaceClassInfo[1].dwValueSize = sizeof(DWORD);
aNameSpaceClassInfo[1].lpValue = &dwUdpPort;
aNameSpaceClassInfo[2].lpszName = SERVICE_TYPE_VALUE_CONN;
aNameSpaceClassInfo[2].dwNameSpace = NS_SAP;
aNameSpaceClassInfo[2].dwValueType = REG_DWORD;
aNameSpaceClassInfo[2].dwValueSize = sizeof(DWORD);
aNameSpaceClassInfo[2].lpValue = &dwZero;
aNameSpaceClassInfo[3].lpszName = SERVICE_TYPE_VALUE_SAPID;
aNameSpaceClassInfo[3].dwNameSpace = NS_SAP;
aNameSpaceClassInfo[3].dwValueType = REG_DWORD;
aNameSpaceClassInfo[3].dwValueSize = sizeof(DWORD);
aNameSpaceClassInfo[3].lpValue = &dwSapId;
WSAInstallServiceClass(&sci);
modified on Thursday, January 29, 2009 11:19 AM
|
|
|
|
|
In MSDN, it says:
A namespace provider is a locally-resident piece of software that knows how to map between the Winsock namespace SPI and some existing namespace (which could be implemented locally or be accessed through the network).
I'm not clear about some concepts:
1. Winsock namespace SPI (and what does SPI stand for here?)
2. some existing namespace
The concepts are too abstract to me, any sample?
Thanks very much.
|
|
|
|
|
followait wrote: and what does SPI stand for here?
Great question. What can you do? Oh I know, how about this[^]
|
|
|
|
|
hi guys,
i have coded a simple program that give the list of files in a directory. i use Visual C++ 2008 to code it. But when i copy and run the exe file from debug folder on other pc its showing " application failed to start because its side-by-side configuration is incorrect.Please see the application event log or use the command-line sxstrace.exe tool for more detail". what should i do ? i need to do this program to run portable in any windows base pc. kidly help me.
Thank you.
Regards ,
Thilek
|
|
|
|
|
Do you have any specific reason why you are "distributing" your DEBUG build? If no, try with a RELEASE build instead.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
Change the Microsoft foundation classes in the projet settings(projectmenu->settings->general tab)to Use MFC in a static library.
Then execute the appln again .Then copy the exe file and try to run in another pc.
|
|
|
|
|
where can i find the projectmenu... is it on the tool bar ?
|
|
|
|
|
Why is it so difficult to find project menu ???
Alternatively Press Alt + F7
|
|
|
|
|
i did as u said but now its showing error...
Embedding manifest...
mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\testing.exe.embed.manifest". The parameter is incorrect.
kindly help me...
|
|
|
|
|
its ok ya.. its running now.. thanks a lot u been very helpful.. thanks a lot....
|
|
|
|
|
thanks for ur idea mate... its working fine now.. thanks a lot ya...
|
|
|
|
|
Hi, can u please help.
Its a small project and involves communication with a device. The data sent by the device is Written to .DAT file (WeightValue.dat).
Following is the code:
CStdioFile fil;
fil.Open("WeightValue.dat",CFile::modeReadWrite);
fil.WriteString(LPCTSTR(value));
fil.Close();
When I try running the exe in Release / Debug Configuration, I get a debug assertion saying :
"Debugging information for ADRTest.exe cannot be found or doess not match.Binary was not built with debug information."
ADRTest.exe has triggered a breakpoint and breaks to show.
void CStdioFile::WriteString(LPCTSTR lpsz)
{
ASSERT(lpsz != NULL);
breakpoint here-> ASSERT(m_pStream != NULL);
if (lpsz == NULL)
{
AfxThrowInvalidArgException();
}
if (_fputts(lpsz, m_pStream) == _TEOF)
AfxThrowFileException(CFileException::diskFull, _doserrno, m_strFileName);
}
Awaiting your kind reply.
Thanks and Regards.
Divya.
|
|
|
|
|
It seems you are trying to run your RELEASE build in debug mode. Could it be that the output directory for your DEBUG and RELEASE targets is the same directory and you previously built a release EXE and now you are trying to run it in DEBUG mode? Even if not, a simple "clean and rebuild" can't hurt...
Aside of that, my guess would be that fil.Open("WeightValue.dat",CFile::modeReadWrite); fails, i think if it does not find the file specified it won't create it for you, so it can't open it. Check the flags for open here[^], i guess you need CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite | CFile::typeText , maybe with the hint of a seeking to the end of the file if you wish to append to it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Try:
CStdioFile fil;
CFileException e;
if (fil.Open("WeightValue.dat", CFile::modeReadWrite, &e) != FALSE)
{
fil.WriteString((LPCTSTR) value);
fil.Close();
} What type of variable is value ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
i m using this.
1. declare it in header file.
protected:
CBrush m_brush;
2. now on OnInitDialg()
m_brush.CreateSolidBrush(RGB(245, 245, 245));
3.now on OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
return m_brush;
but here edit contol also colored with this color.
please tell me how can i change Back ground color of dialog box and back ground color of static control.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi,
Create a class for the control, then return the brush in OnCtlColor()(in the new class).Just try it iam not sure about the result.
|
|
|
|