|
And rightly so since you've given it an invalid buffer. Did it ever occur to you to check here? As this is all elementary stuff, I'm thinking Excel Automation might just be a bit beyond your current skillset.
"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
|
|
|
|
|
sorry i didnt check the documentation
i m getting the following error
coinitialise has not been called
|
|
|
|
|
prithaa wrote: i m getting the following error
coinitialise has not been called
I knew this thread was about 15 posts too long. See here. Since you did not answer, I just assumed you had it right and the problem was elsewhere.
"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
|
|
|
|
|
i think it will be done
thnk you
|
|
|
|
|
Hi there,
Is it posible, using vs2008 express, to copile a c++ application (not managed c++).
I don't want a .NET application.
Can that be done? How?
Thanks!
|
|
|
|
|
Hi,
SummerBulb wrote: Is it posible, using vs2008 express, to copile a c++ application (not managed c++).
Yes.
SummerBulb wrote: Can that be done? How?
Simple tutorial -> here[^].
You can find more tutorials by googling.
Nuri Ismail
|
|
|
|
|
I think you might have misunderstood my.
I know how to write c++ code. I also know how to write code in VS2008.
What i am looking for is a way to write code in VS2008 express and compile it using the regular c++ compiler, and not using the managed c++ compiler that comes with the VS2008 express IDE.
Or am i missing something here?
|
|
|
|
|
Hi,
The C++ compiler in VS2008 Express (and other editions) is not a managed compiler. It is regular C++ compiler. For managed C++ there is a C++/CLI . So when you set your project type to Visual C++ , this means that you will use unmanaged C++ compiler.
I hope this helps.
Regards,
Nuri Ismail
|
|
|
|
|
|
I am creating a text file at run time and writing some strings to it but, all strings are coming in one line how to insert blank line in the text file?
i am using following function:
StringCchPrintf(lpBuffer, sizeof(lpBuffer)/sizeof(TCHAR),TEXT("%s"),lpBuffer);
"\n" is not working here..
|
|
|
|
|
\r\n
If you vote me down, my score will only get lower
|
|
|
|
|
Hi all,
I want to copy a large string(2500 chars) to VARIANT data type.
I tried with following function.But it is showing exception.How can i copy large string to a variant?
int n =MultiByteToWideChar(CP_ACP, 0, lpszitems, -1, wchItems,
2500);
lpList->vt = VT_BSTR;
lpList->bstrVal = SysAllocString(wchItems);
i have allocated size to lpszitems variable to 2500.Is it possible to allocate size to variant datatype.
Thanks,
|
|
|
|
|
If a crash is happening then problem is elsewhere. If the function SysAllocString is not able to allocate memory to copy full wchItems then it shoudl return NULL peacefully.
Probably, wchItems is not properly terminated (unicode strings require \0\0) or the problem is elsewhere. I dont think 2500 chars is a very long string but then i dont think in any case,
|
|
|
|
|
the VARIANT has only the pointer to the data, it gets allocated with SysAllocString(wchItems);
Where happened the execption?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
The following code runs 'exception-free' on my system:
#include <windows.h>
void main()
{
char lpszitems[2500];
wchar_t wchItems[2500];
memset(lpszitems, 'A', 2499);
lpszitems[2499]= '\0';
int n =MultiByteToWideChar(CP_ACP, 0, lpszitems, -1, wchItems,
2500);
if (n==0)
{
DWORD dw = GetLastError();
int k=5;
}
VARIANT * lpList, vt;
lpList = &vt;
VariantInit(lpList);
lpList->vt = VT_BSTR;
lpList->bstrVal = SysAllocString(wchItems);
}
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]
|
|
|
|
|
Hello,
Why doesn´t this code return "sumatorio=5"???
<br />
#include <stdio.h><br />
<br />
int main(void)<br />
{<br />
int sumatorio;<br />
int sum;<br />
<br />
sumatorio=0;<br />
for(sum=0; sum<5; sum++)<br />
{<br />
sumatorio=sumatorio+1 ;<br />
}<br />
<br />
printf("Sum: %i .\n", sumatorio);<br />
<br />
<br />
return 0;<br />
}<br />
|
|
|
|
|
the code looks good (tested on xcode on mac); sumatorio is 5 after the loop.
This signature was proudly tested on animals.
|
|
|
|
|
does it return "Sum: 5 ."? sumatorio is indeed 5.
|
|
|
|
|
because the coder wrote "return 0;"
PS: the biggest failure cause sits before the PC
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
The printf statement needs a %d for outputting an integer:
printf("Sum: %d .\n", sumatorio);
|
|
|
|
|
jon_fallon wrote: The printf statement needs a %d for outputting an integer:
For signed decimal integers we could use: %d or %i . They are synonymous for the output (printf() ). You can check this here[^].
Regards,
Nuri Ismail
|
|
|
|
|
programmer202 wrote: Why doesn´t this code return "sumatorio=5"???
Because you did not tell it to!
|
|
|
|
|
Hello,
I am using a Static Element of type "enhanced metafile" on a dialog to display metafiles. Now I'd like to have the metafile displayed rotated by 180 degree. I s there an easy way to do this, for example by defining a new viewport, and how can this be done?
|
|
|
|
|
below is my code.i m using CIPAddressCtrl contorl of vc++(mfc).problem is that we thia case statement is execatuted messagebox is dispaly twice.I wont understand .Plz anyone has idea about this help me to solve my problem..
void CServerIPAddress::OnIpnFieldchangedServerIpaddress(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMIPADDRESS pIPAddr = reinterpret_cast<LPNMIPADDRESS>(pNMHDR);
*pResult = 0;
int nFieldIndex = pIPAddr->iField;
int nValue = pIPAddr->iValue;
CString csValueFormat;
switch(nFieldIndex)
{
case 0:
{
if(nValue < 1 || nValue > 223)
{
csValueFormat.Format(_T("%d Is not a valid entry."),nValue);
csValueFormat.Append(_T("Please specify a value between 1 and 223"));
AfxMessageBox(csValueFormat);
}
}
break;
default:break;
}
}
|
|
|
|
|
jadhavjitendrar wrote: Why Messagebox display twice It's Urgent
It shows two times because it's urgent.
BTW:
- reposting isn't good.
- urgentz requests go automatically into the recycle bin.
- your code snippet is not properly formatted.
- you may modify you original post, adding more details (for instance is your application multithreaded?).
Please read the forum guidelines [^], before posting.
[added]
'Mr.Univoter The Coward' beware: "the spiderman is having you for dinner tonight"!
[/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 Wednesday, September 23, 2009 6:36 AM
|
|
|
|