|
|
Great! If you see some painting problems in the future, feel free to post again.
|
|
|
|
|
Hi All,
I want to know which OS am using from C code.Is it is possible?.
Thanks
Mohan t
|
|
|
|
|
Have you looked at GetVersion() ? (it's platform dependent)
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Does Linux provide that?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Actually i have created one dll USING Windows OS AND ONE MORE DLL USING Unix,so i want to know which dll created from which OS(from C programming).
Gimme an IDEA .
Thanks,
Mohan.T
Mohan tC
|
|
|
|
|
Well, since you've already created the platform-independant code then both your dynamic libraries may provide a function, say tellMeTheOS() .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
If you've used the right naming conventions, the Windows one will have a .dll extension, the Unix one a .so (for shared object) extension
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
You can't. In your build system you need to handle this, for example on Windows you will build a DLL/LIB and on Linux a SO/A. Once you know on which target you are, you can find out on runtime which Windows version or Linux distibution the code runs on. So you will need specific C/C++ code for different platforms.
|
|
|
|
|
I'm capturing image data from a webcam using a simple class found here[^].
CVFWCapture cap;
PBITMAPINFO pBitmap = NULL;
ULONG BitmapSize;
if(!cap.Initialize())
{
MessageBox(NULL, _T("Failed to initialise capture device. Terminating."), _T("Error!"), MB_OK);
return 0;
}
if(!cap.CaptureDIB(&pBitmap, 0, &BitmapSize))
{
MessageBox(NULL, _T("Failed to capture image from device. Terminating."), _T("Error!"), MB_OK);
return 0;
}
else
{
}
With the above code, I get a PBITMAPINFO structure which contains all the header data of the file, but there's no way for me to access the pixel data from this struct (obviously the struct is the header of a bmp file only). Is there a function I can use to get a pointer to the pixel data from this struct? From the way the class was advertised in the article, I was under the impression this class is used to capture image data - surely there isn't much use in only being able to access header info... Am I wrong or am I just missing something?
|
|
|
|
|
Sauce! wrote: Is there a function I can use to get a pointer to the pixel data from this struct?
AFAIK no.
[added]
From a quick look at article source code, it looks like the pixel data section (after the CaptureDIB call) is in memory just after the BITMAPINFO struct (like bitmap files).
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Tuesday, September 15, 2009 8:39 AM
|
|
|
|
|
In that case, does anybody know of any existing libraries that will allow me to simply capture pixel data from a video device?
|
|
|
|
|
Hi VC++ programmers,
how to programmatically and silent create MSWord document using .dot file as a template and data from dialog based app ? Env: VS6, WordXP/Word2003, WinXP.
Thanks in advance.
|
|
|
|
|
Create an instance of Word's Application object, then use the Add method of the Application's Documents property to create the document - you can specify the template in that method call.
Don't know what you mean by "data from dialog based app"
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for reply.
I mean get text from various fields and insert into specific places in document.
|
|
|
|
|
Well - getting text from dialog fields - you can find that out from any number of places - this link[^] should help.
As for inserting into the document - well, you need to navigate through the document using the Word object model. The Document object has a Content property, which is a Range object representing the main flow of text in the document. A Range object has various properties (like Paragraphs or Characters properties) that allow you to manipulate the text in the document. Prototype in Visual BASIC - it's a lot quicker and easier.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks,
now I know the way to investigate the issue
|
|
|
|
|
Hi friends,
Below line contain my code.I m writting data into the text file.i have acess database and i write this databse into text file format. my access databse table contain 99 records and i m using CDaoRecordset MoveNext() to get next record data.Problem is that i get record till 18 its ok but after that i get 20 position record and afterthat i get 19 position record.then i get 26 to 30 position record and then i get 21 to 25 record data.But data in the database table is sequentially.So why this problem will occour i wont understand.
Plz help me..
m_pRecordSet = new CDaoRecordset(m_pDatabase);
CString strTablename = _T("pdpstate");
m_pRecordSet->Open(dbOpenTable,strTablename);
int nRecordCnt = m_pRecordSet->GetRecordCount();
int nFieldCnt = m_pRecordSet->GetFieldCount();
CDaoFieldInfo cTempdaoFieldInfo;
CString csSetID,csFieldStr;
CStdioFile cTestFile;
cTestFile.Open(_T("d:\\Jitu45.txt"),CStdioFile::modeCreate | CStdioFile::modeWrite);
for(int nfCnt = 0; nfCnt < nFieldCnt; nfCnt++)
{
m_pRecordSet->GetFieldInfo(nfCnt,cTempdaoFieldInfo);
cTestFile.WriteString(cTempdaoFieldInfo.m_strName);
cTestFile.WriteString(_T(","));
}
cTestFile.WriteString(_T("\n"));
while(!m_pRecordSet->IsEOF())
{
COleVariant variantTemp;
//..// Move through fields in current record..
int nFields = m_pRecordSet->GetFieldCount();
for ( int i=0; i < nFields; i++ )
{
variantTemp.Clear();
variantTemp = m_pRecordSet->GetFieldValue(i);
csSetID.Format(_T("%d"),variantTemp.intVal);
cTestFile.WriteString(csSetID);
cTestFile.WriteString(_T(","));
}
cTestFile.WriteString(_T("\n"));
m_pRecordSet->MoveNext();
}
cTestFile.Close();
|
|
|
|
|
What about an ORDER BY clause in the query?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ORDER BY can be achieved by setting the COLUMN_NAME by which you want to sort the records to the "m_strSort" member of the CDaoRecordset class.
|
|
|
|
|
Hi All
How can i convert _variant_t to CString?
|
|
|
|
|
I suppose you need the string representation of the _variant_t value.
You've to properly format a CString object, depending on the value of the vt member of the encapsulated VARIANT struct. For instance
CString str;
_variant_t v1;
v1 = 0.53;
switch (v1.vt)
{
case VT_R8:
str.Format(_T("%g"), v1.dblVal);
break;
}
MessageBox(str, _T("Variant value"));
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Noooooo - you don't need to bother with that - there's a VariantChangeType function that'll do that for you when you convert a VARIANT to a BSTR.
And even more conveniently, the combination of _variant_t extractor operators and CString constructors will do all that for you. A simple assignment of _variant_t to CString is all that's needed...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Nice to know .
What about _variant_t containing arrays?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: What about _variant_t containing arrays?
Use CComSafeArray[^].
_variant_t v;
CComSafeArray<char, VT_UI1> sa(V_ARRAY(&v));
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|