|
#include <iostream>
int SetVal_1(int iNum)
{
return iNum +1;
}
int SetVal_2(int iNum)
{
return iNum * 2;
}
int SetVal_3(int iNum)
{
return iNum * 3 + 4;
}
void main()
{
int LuckyNum = SetVal_1(5), SetVal_2(6), SetVal_3(7);
printf("Lucky number = %d\n", LuckyNum);
}
BuggyMax
|
|
|
|
|
Because commas are used for other things. Semicolons are used for the end of a statement, so why not use them? If you use commas, the code basically looks like one big function call. I'm not sure why you'd want to use commas over semicolons.
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 want to open a file but when I try to open it nothing comes up just the last thing I wanted. I know what it is you know cleaning the last work and loading the next but I forgot how to do it... Help??
[It is possible to represent everything in this universe by using 0 and 1]
|
|
|
|
|
Hi Im wondering how i can associate certain file extension to my program and have it run the program when the person opens a file with that extension any help is appreciated
thanks
|
|
|
|
|
Hi
To associate a file extension to your program, you should create a registry entry under
HKEY_CURRENT_USER
-->Software
-->Microsoft
-->Windows
-->CurrentVersion
-->Explorer
-->FileExts.
1. Under FileExts create a key with same name as your file extension.
(Eg: For bitmap files you can find a key named .bmp under FileExts.)
2. Also create a subkey named "OpenWithlist".
3. Add a string value named "a".
4. Set the value data of this key as your application path.
(Eg: for paint you can find the entry mspaint.exe as value data)
Mahesh
|
|
|
|
|
Hi
Sorry i made a mistake.
1. Under the FileExt key, add a string value named "Application".
2. Set the value data of this string value as your application path.
(Eg. For .bmp you can see this value as mspaint.exe)
Mahesh
|
|
|
|
|
i need a library of converting bmp to jpeg.
but i don't find it.
can you tell me where i can download it ?
must http download!
thx
hxr601
|
|
|
|
|
Hi
Try CxImage library.
http://www.codeproject.com/bitmap/cximage.asp
Mahesh
|
|
|
|
|
Hello,
I've got a tree control on my dialog with checkboxes. Everything works fine, except that I cannot find a proper way to check wheter the checkbox is checked or not .
It's probably a simple tiny thing, but I can't find it! Does anybody know what I have overlooked?
Thanks in advance.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
If you are using MFC use this:
BOOL CTreeCtrl::GetCheck( HTREEITEM hItem ) const;
If you are using Win32 API, you have to send a message:
TVITEM item;
item.mask = TVIF_HANDLE | TVIF_STATE;
item.hItem = hItem;
item.stateMask = TVIS_STATEIMAGEMASK;
::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)&item);
bChecked = (BOOL)(item.state >> 12) -1;
Hope that helps
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
This sure helps!
thanks a lot!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Hi all...
I m working on win32 console application....
does anyone know how can I delete a file?
=-=-=-=-=-=
The Server
|
|
|
|
|
_unlink()
or
DeleteFile()
- Mike
|
|
|
|
|
Hi
DeleteFile(lpFileName)
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Mahesh
|
|
|
|
|
I'm trying to make a program just like notepad but a little bit more "Funner". I have nothing right now on my spare time to do so don't ask. I can't seem to find a function to clear the recent file list when you click the 'File' in the menu. Can anyone help me??
[It is possible to represent everything in this universe by using 0 and 1]
|
|
|
|
|
The MRU list is a CRecentFileList member of the CWinApp object. It has a Remove() method.
|
|
|
|
|
Anybody knows about a way to spy a thread windows message queue from a different process. Is there a way to log all the messages of Program A - thread 1 message queue from Program B?
|
|
|
|
|
|
|
This is my first OCX control. I managed to "hack" through using an example and can Get/Set the stock properties through a "wrapper class", however, I am having trouble adding one of my own custon properties. I am using VC++ 7.0.
Wrapper Class:
//--------------------------------------------------------------------------------.cpp
void CWrap::m_vSetParams(int nPtSize)
{
// I am able to get nPtSize!
return;
}
//---------------------------------------------------------------------------------.h
---
void m_vSetParams(int, CString);
---
OCX Control Class
//--------------------------------------------------------------------------------.cpp
//DISPATCH MAP
---
DISP_PROPERTY_EX(CGrpBoxExCtrl, "PointSize", GetPtSize, SetPtSize, VT_I2)
--
//DISPATCH MAP
void MyOCXCtrl::SetPtSize(short nPtSize)
{
m_nPtSize = nPtSize;
return;
}
BSTR MyOCX::GetPtSize()
{
return ........
}
//---------------------------------------------------------------------------------.h
short m_nPtSize;
---
public:
enum {};
afx_msg void SetPtSize(int);
afx_msg short GetPtSize();
---
//---------------------------------------------------------------------------------.odl
Totally Lost Here!
//---------------------------------------------------------------------------- Question
How do I get the information (nPtSize) from the "wrapper" class to the control. Could
someone please fill in the above or direct me to a simple artical or sample that would guide
me.
Is there a Wizard that does this, and if so, where in the Visual Studio editor is it?
Need I point out that MSDN is totally & hopelessly confusing?
Barry
|
|
|
|
|
Hi
I´m new to C++ and working with passing files back and fourth to a
webservice. I have found som code in C# that does this for me but I can´t
convert it into C++. Can someone please help me with the two last lines?
DimeAttachment attachment = new DimeAttachment("application/octet-stream",
TypeFormatEnum.MediaType, ms);
HttpSoapContext.ResponseContext.Attachments.Clear();
HttpSoapContext.ResponseContext.Attachments.Add(attachment);
I keep on getting the error C2512
...
HttpSoapContext *hsc;
hsc = new HttpSoapContext;
...
is not possible
Regards
Daniel
|
|
|
|
|
The HttpSoapContext class needs a default constructor. Can you show us the class declaration?
|
|
|
|
|
Hi
Thank you for the answer, the class declaration goes as follows.
*******************************
HttpSoapContext Class
HttpSoapContext Members | Microsoft.Web.Services Namespace
Requirements
Namespace: Microsoft.Web.Services
Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: Microsoft.Web.Services (in Microsoft.Web.Services.dll)
Provides access to the SoapContext associated with a SOAP request and SOAP response for XML Web services created using ASP.NET. This class cannot be inherited.
For a list of all members of this type, see HttpSoapContext Members.
System.Object
Microsoft.Web.Services.HttpSoapContext
[C++]
public __gc __sealed class HttpSoapContext
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Remarks
The SoapContext provides access to the WS-Security, WS-Routing, and other XML Web services architecture-specific details associated with a SOAP message.
Use this class to gain access from within an XML Web service to the the SoapContext associated with a SOAP request through the static members RequestContext and ResponseContext.When an XML Web service method is a one-way method, an XML Web service cannot gain access to the SoapContext using the static members of this class. To gain access to the SoapContext for one-way methods, the class implementing the XML Web service should inherit from System.Web.Services.WebService and add code within the one-way method to get the Context property.
Requirements
Namespace: Microsoft.Web.Services
Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: Microsoft.Web.Services (in Microsoft.Web.Services.dll)
********************************
Regards
Daniel
|
|
|
|
|
This is the class documentation, not the declaration. A class's declaration is usually kept in a .H file.
|
|
|
|
|
Hi
Hmm.. I can´t find the declaration on my computer, is it possible? It´s under the namespace Microsoft.Web.Services imported from the dll with the same name.
How do I proceed?
// Daniel
|
|
|
|