|
Thanks for this, tigress - they wernt functions I was aware of - glad someone else out there knew where they came from
'G'
|
|
|
|
|
Thank you very much.
I do have installed DirectX SDK,and I do have linked them.
I have resolved it the reason is I lefted a .lib file
that is "Dxguid.lib"
You may use 'dsound.h',dxguid.h'winmm.h'dxerr8.h'.
Thank you all the same!
|
|
|
|
|
Hi, I am trying to code for some image acquisition application and I need to handle two hardware in my coding. One of them is a camera while the other is an image pattern generator which could be programmed. The camera can be set to be on, taking in sequence of images while the image pattern generator would change at some prefix timing
I am trying to do some threading coding to run both of the device in parallel. So I am wondering whether I could do the following and get some synchronisation
acqthread{
......
......
CameraHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) cameraThread, (void *)this, 0, &dwThreadId);
PatternGenHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) PatternGenThread, (void *)this, 0, &dwThreadId);
WaitForMultipleObjects(2, hEVents, TRUE,INFINITE);
}
DWORD CameraThread(void * pv){
.......
// run a sequence of events
}
DWORD PatternGenThread(void * pv){
.......
// Load a series of patterns
}
Would it also work if I only create one thread and put the coding of one hardware into the main function? Or does the running of the main thread has piority over the subthread?
|
|
|
|
|
Watertreader wrote:
Would it also work if I only create one thread and put the coding of one hardware into the main function?
It is probably best to have a worker thread for each piece of hardware. This would leave your main thread free to act as a control for the other threads, and to do a controlled shutdown of the application. If you use your primary thread to control one piece of hardware, it is more difficult to regain control of the application if that hardware causes the thread to lock up.
Watertreader wrote:
Or does the running of the main thread has piority over the subthread?
This is not usually the case. You can alter thread priorities if you need to, however.
Software Zen: delete this;
|
|
|
|
|
before i call GetQueuedCompletionStatus function, GlobalAlloc have no problem. but after i call GetQueuedCompletionStatus function, many functions meet a "int 3" . why????????? in C++
sd
|
|
|
|
|
While working with "Execl XML toolbox" in C++, I attempt to implement
a logic which is equivalent to the following VB piece of code:
Public objExcelApplication As Excel.Application
Public objWorkBook As Excel.Workbook
Public objWorkSheet As Excel.Worksheet
Public objXmlMap As Excel.XmlMap'
1. list XML maps in the given Book:
.
.
Dim oMapInfo As Excel.XmlMap
For Each oMapInfo In objWorkBook.XmlMaps
msgbox oMapInfo.Name
Next
' 2. Pass back an Excel schema source
dim xSchema As String
xSchema = objXmlMap.Schemas(1).XML'
3. Export The Excel data as XML
dim xData As String
Call objXmlMap.ExportXml(xData)
All necessary standard libraries are #imported into my C++ code / project:
MSO.DLL - contributes MS Office
VBE6EXT.OLB - contributes VB extensions
EXCEL.EXE - for Excel.
However - none of them exposes any helpers, wrappers or any thing else
by which xmlMaps , xmlScemas collections and their associated contained items xmlMap,xmlSchema -
can be accessed easily like other Excel entities.
What did I miss?
Thanks
Hillel.
Hillel
|
|
|
|
|
Hi,
I am trying to get the types of drives (floppy, hard disk, CDROM, etc.) that Directory::GetLogicalDrives() returns. Directory::GetLogicalDrives() returns an array of strings. How do i get this in .NET?
TraileR ParK LifE 4Ever
|
|
|
|
|
I have a question about the value returned in the fifth parameter (lpulObjType ) of the OpenEntry() function.
For reference here is the prototype
HRESULT OpenEntry(
ULONG cbEntryID,
LPENTRYID lpEntryID,
LPCIID lpInterface,
ULONG ulFlags,
ULONG * lpulObjType,
LPUNKNOWN * lppUnk
}; According to MSDN[^] "Because the address book provider might return a different interface than the one suggested by the lpInterface parameter, the caller should check the value returned in the lpulObjType parameter to determine that the object type returned is what was expected."
Now that is all fine and good, but does anyone have any idea what the proper return values are for the lpulObjType parameter? How can I check the value if I have nothing to check it against? If I ask for an IMailUser interface how can I be sure, using the lpulObjType value, that the interface I get is an IMailUser interface?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
Now that is all fine and good, but does anyone have any idea what the proper return values are for the lpulObjType parameter? How can I check the value if I have nothing to check it against? If I ask for an IMailUser interface how can I be sure, using the lpulObjType value, that the interface I get is an IMailUser interface?
I have never worked with this, but looking at the documentation for IMsgStore::OpenEntry[^], which also has a similar parameter, I'd guess that the object type would be one of the possibilities shown for the PR_OBJECT_TYPE property[^], and that in your particular case the expected type would be MAPI_MAILUSER , which is defined as ((ULONG) 0x00000006) in MAPIDefS.h
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thank you, it helps very much
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
I want to open a non-existing file, and write to it and read from it without closing and re-opening.
open using CreateFile(). which parameters should be used for this function?
|
|
|
|
|
How about:
HANDLE hFile = CreateFile(..., GENERIC_READ | GENERIC_WRITE, ...);
WriteFile(hFile, ...);
SetFilePointer(hFile, ...);
ReadFile(hFile, ...);
CloseHandle(hFile);
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I want to see what kind of connection a computer has. To this end I am using the InternetGetConnectedState function(if you have any better ideas I am all ears).
<br />
<br />
char * tip_de_conexiune(void)<br />
{<br />
char respuns[1024];<br />
<br />
DWORD tip_de_conexiune;<br />
<br />
InternetGetConnectedState(&tip_de_conexiune,0);<br />
<br />
switch(tip_de_conexiune)<br />
{<br />
<br />
case INTERNET_CONNECTION_LAN:<br />
{<br />
strcpy(respuns,"lan"); <br />
MessageBox(0,"lan","lan",MB_OK);<br />
}<br />
break;<br />
<br />
case INTERNET_CONNECTION_MODEM:<br />
{<br />
strcpy(respuns,"dialup");<br />
MessageBox(0,"modem","modem",MB_OK);<br />
}<br />
break;<br />
<br />
case INTERNET_CONNECTION_OFFLINE:<br />
{<br />
strcpy(respuns,"offline");<br />
MessageBox(0,"offline","proxy",MB_OK);<br />
}<br />
break;<br />
<br />
case INTERNET_CONNECTION_CONFIGURED:<br />
{<br />
strcpy(respuns,"configurat");<br />
MessageBox(0,"configured","proxy",MB_OK);<br />
}<br />
break;<br />
<br />
}<br />
MessageBox(0,"a","b",MB_OK);<br />
<br />
return respuns;<br />
}<br />
<br />
this works but it returns none of the predefined values either when I am on or offline. I have a dialup connection.
any other way of doing this?
or what is wrong with this?
|
|
|
|
|
Spiritofamerica wrote:
what is wrong with this?
Each of those values is a bit flag. The result contains one or more of them. If you use a switch on the result you are checking for each of them but excluding the possibility of combinations.
Try something like this instead:
CString sFlags;
if (tip_de_conexiune & INTERNET_CONNECTION_LAN)
sFlags += "Lan ";
if (tip_de_conexiune & INTERNET_CONNECTION_MODEM)
sFlags += "Modem ";
if (tip_de_conexiune & INTERNET_CONNECTION_OFFLINE)
sFlags += "Offline ";
if (tip_de_conexiune & INTERNET_CONNECTION_CONFIGURED)
sFlags += "Configured ";
AfxMessageBox(sFlags);
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
thanks man
it works now when I am online
it correctly shows modem configured as in the 2nd and 4th ifs in your code
but when I am offline it shows nothing it does not show offline
why is this man?
and everybody else that might know?
|
|
|
|
|
the return value is 0x12 always as I tested.
includeh10
|
|
|
|
|
how did you test includeh10?
|
|
|
|
|
UINT uValue=InternetGetConnectedState();
CString cs;
cs.Format("0x%X, %d",uValue,uValue);
MessageBox("Hello",cs,MB_OK);
-------------------------
I use broadband at home.
includeh10
-- modified at 19:55 Sunday 28th August, 2005
|
|
|
|
|
See here also.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi!
How do I calculate the value of dwBloblen of pbKeyBlob read from a file.Even if i use the number of byted read returned from the CFile read function the key import function fail.How does the know the receiving side know the size of KEYBLOB.
////read KEYBLOB from a received file
CFile file;
BYTE *pbKeyBlob1 = NULL;
DWORD dwBlobLen1=512; //just for testing but doesnt work for RSA
//signature
pbKeyBlob1 = (BYTE*)malloc(dwBlobLen1);
// Read the key BLOB from the file.
if(file.Open("key.txt",CFile::modeRead))
{
file.Read(pbKeyBlob1,dwBlobLen1);
file.Close();
}
// call CryptImportKey
if(CryptImportKey(
hProv,
pbKeyBlob1,
dwBlobLen1,
0,
0,
&hPubKey))
{
MessageBox("The key has been imported");
}
else
{
MessageBox("The key import failed");
}
|
|
|
|
|
|
Have some legacy code generator (EZbuilder) which reqires Visual v 1.52. Where can I get a copy?
|
|
|
|
|
It's difficult to get 6.0 let alone 1.52. I reccommend you port your code to a current compiler.
Elaine
The tigress is here
|
|
|
|
|
Ver. 1.52 was the last version of the Win 3.1 (16-bit compiler). It was include with the release of VC Ver. 4.0.
You need to bring the code upto date.
It's not that difficult, just time consuming.
The MSDN covers the subject of updating 16-bit programs to 32-bit, some where.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|