C function prototype

 Is that for Class/Object function prototype, I must define the
function in header file or .cpp file.

MyClass::functionA();
MyClass::functionB();

but for C function prototype, I don't have to define if it's put
before the main() function the following is not needed -

void stradd (char *s1, char *s2);
void stradd (char *s1, int i);

=========
#include  <iostream> // cannot be iostream.h??
#include  <stdio.h>
#include  <string.h>


#include <comdef.h>
#include <conio.h>
#include <windows.h> // must need for SYSTEMTIME

//must need C/C++ > General > Debug Information Format to debug
working

using namespace std; // for cout must have??

// concatenate two strings
void stradd (char *s1,  char *s2)
{
	strcat (s1, s2); // CRT <string.h> function
}

// concatenate a string with a "stringized" integer
void stradd (char *s1,  int i)
{
	char  temp[80];

	sprintf (temp, "%d", i);
	strcat (s1, temp);
}



int main()
{
	//SYSTEMTIME st = {0,0,0,0,0,0,0,0}; // cannot divide into 2
lines - must init all in one line
	SYSTEMTIME st = {0}; // OK too

	char   str[80];
	//char* str; // not OK will crash program

	strcpy (str, "Hello ");
	stradd (str, "there");
	cout << str << "\n";

	stradd (str, 100);
	cout << str << "\n";

	stradd (str, "hihi");
	cout << str << "\n";	

	return 0;
}


0
iiuu66 (13)
4/12/2008 10:47:37 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
783 Views

Similar Articles

[PageSpeed] 4

"June Lee" <iiuu66@yahoo.com> wrote in message 
news:iue204d960od868lfjsmggru2b80vkctc3@4ax.com...
> Is that for Class/Object function prototype, I must define the
> function in header file or .cpp file.
>
> MyClass::functionA();
> MyClass::functionB();
>
> but for C function prototype, I don't have to define if it's put
> before the main() function the following is not needed -
>
> void stradd (char *s1, char *s2);
> void stradd (char *s1, int i);
>
> =========
> #include  <iostream> // cannot be iostream.h??
> #include  <stdio.h>
> #include  <string.h>
>
>
> #include <comdef.h>
> #include <conio.h>
> #include <windows.h> // must need for SYSTEMTIME
>
> //must need C/C++ > General > Debug Information Format to debug
> working
>
> using namespace std; // for cout must have??
>
> // concatenate two strings
> void stradd (char *s1,  char *s2)
> {
> strcat (s1, s2); // CRT <string.h> function
> }
>
> // concatenate a string with a "stringized" integer
> void stradd (char *s1,  int i)
> {
> char  temp[80];
>
> sprintf (temp, "%d", i);
> strcat (s1, temp);
> }
>
>
>
> int main()
> {
> //SYSTEMTIME st = {0,0,0,0,0,0,0,0}; // cannot divide into 2
> lines - must init all in one line
> SYSTEMTIME st = {0}; // OK too
>
> char   str[80];
> //char* str; // not OK will crash program
>
> strcpy (str, "Hello ");
> stradd (str, "there");
> cout << str << "\n";
>
> stradd (str, 100);
> cout << str << "\n";
>
> stradd (str, "hihi");
> cout << str << "\n";
>
> return 0;
> }
>
>

In your simple example, you get away with providing full function 
definitions before the compiler encounters the first call. The point of 
prototypes is to give the compiler enough to recognize calls before the full 
definition is parsed. In a more complex example, where you have numerous 
functions which call each other, it can become impossible to define the 
functions in an order that satisfies all calls. Prototypes obviate such 
issues by ensuring the compiler will recognize all calls regardless of the 
order of the full definitions.

0
pvdg (5)
4/12/2008 10:57:06 PM
On Sat, 12 Apr 2008 15:47:37 -0700, June Lee <iiuu66@yahoo.com> wrote:

> Is that for Class/Object function prototype, I must define the
>function in header file or .cpp file.
>
>MyClass::functionA();
>MyClass::functionB();
>
>but for C function prototype, I don't have to define if it's put
>before the main() function the following is not needed -
>
>void stradd (char *s1, char *s2);
>void stradd (char *s1, int i);
****
First rule: forget the data type 'char' exists except in very rare and exotic situations,
of which this is not one.  'char' is effectively obsolete for modern programming.

void stradd(LPTSTR s1, LPTSTR s2);
void stradd(LPTSTR s1, int i);

Note that your fundamental design is flawed beyond redemption, because you are using
strcat, which is now VERY obsolete and whose existence should be ignored.  It is unsafe.
It should NEVER be used.

The correct declarations for modern programming would be

void stradd(CString & s1, const CString & s2);
void stradd(CString & s1, int i);

because CString is a correctly-handled type that can never have a buffer overrun when used
correctly.

Since you are clearly learning C, it is critical that you do NOT develop bad programming
habits early.  Use of 'char', use of 'strcat', are now considered VERY BAD programming
style.
****
>
>=========
>#include  <iostream> // cannot be iostream.h??
>#include  <stdio.h>
>#include  <string.h>
>
>
>#include <comdef.h>
>#include <conio.h>
****
You shoud not conio for anything; 
****
>#include <windows.h> // must need for SYSTEMTIME
>
>//must need C/C++ > General > Debug Information Format to debug
>working
>
>using namespace std; // for cout must have??
>
>// concatenate two strings
>void stradd (char *s1,  char *s2)
>{
>	strcat (s1, s2); // CRT <string.h> function
****
This is so unbelievably unsafe that no sane programmer would write this code today.  DO
NOT use strcat!  It is UNSAFE.  
****
>}
>
>// concatenate a string with a "stringized" integer
>void stradd (char *s1,  int i)
>{
>	char  temp[80];
>
>	sprintf (temp, "%d", i);
>	strcat (s1, temp);
****
There are so many things wrong here it is mind boggling.  You are using 'char'.  You are
using a fixed-size array; you are using sprintf, which is unsafe, and you are using
strcat, which is unsafe.  The CORRECT way to write this code in MFC/ATL is
	void stradd(CString & s1, int i)
	    {
                     CString s;
	     s.Format(_T("%d"), i);
	     s1 += s;
                   }

This is the only acceptable style of coding that should be used.  You can also use
std::string, but CString is well-integrated into MFC and ATL and is the preferred class.
But fixed-size buffers, strcat, strcpy, and sprintf should NEVER enter your programming
vocabulary.  They are so bad that if they did not already exist, nobody would be dumb
enough to create them!  (I thought they were a stupid idea in 1975 when I first discovered
C, and guess what, 30 years later everyone seems to have made the same discovery!)
****
>}
>
>
>
>int main()
>{
>	//SYSTEMTIME st = {0,0,0,0,0,0,0,0}; // cannot divide into 2
>lines - must init all in one line
****
The above comment is not true; it can be multiple lines!
	SYSTEMTIME
	    st 
	      =
		{
		 0
		 .
and so on!
****
>	SYSTEMTIME st = {0}; // OK too
>
>	char   str[80];
>	//char* str; // not OK will crash program
>
>	strcpy (str, "Hello ");
>	stradd (str, "there");
>	cout << str << "\n";
>
>	stradd (str, 100);
>	cout << str << "\n";
>
>	stradd (str, "hihi");
>	cout << str << "\n";	
>
>	return 0;
>}
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
4/12/2008 11:18:29 PM
I had to rush off to an appointment, and thought of a few more things along the way.

First, the existence of the CRT does not prove that the functions are particularly
well-designed, or even appropriate for modern programming.  The new CRT, first delivered
with VS2005, uses "safe" functions, like strcpy_s, which are the ONLY forms of CRT
functions that should be used.  If you do not have VS2005, you can download the Platform
SDK and use the functions in strsafe.h instead; they are also safe.  But the following
functions should NEVER be used, even in existing programs.
	strcpy
	strcat
	sprintf
	itoa
	itof
there are probably more, but these are functions so bad that it is essentially insane to
use them, particularly in the way you are doing.  Your techniques are the kind of
techniques that lead to headlines of the form "300,000 computers crippled in first hour of
the KILLME virus attack...", and you do not EVER want to be part of a project that can
generate such headlines.  The above functions are particularly good ways to get those
headlines, and therefore must be absolutely avoided.

ANother thing: if you have a pointer to something that is being read but not written, you
should ALWAYS include the word 'const' in the declaration.  For example, the prototype of
your stradd should be

void stradd(LPTSTR dest, SIZE_T len, LPCTSTR src);
which, in an ANSI build, turns into
void stradd(char * dest, size_t len, const char * src);
and in a Unicode build turns into
void stradd(wchar_t * dest, size_t len, const wchar_t * src);

the len is a critical parameter; it is YOUR responsibility to see that under NO IMAGINABLE
CONDITIONS will more characters be copied into dest than len allows, including the
terminating NUL character (this is what strcat_s does, for example).  Any other approach
is an invitation to complete, flaming disaster, the kind that makes the aforementioned
headlines.

But ultimately, think of the string-handling capabilities of the CRT as dead, dead, dead,
dead.  Use CString in ATL/MFC apps, or std::string in other apps, and never, ever use the
unsafe versions of the CRT routines for ANYTHING.

And ALWAYS think of 'char' as a rare and exotic data type, never used for real programming
of strings.  It is used in very, very limited ways, when you absolutely, positively know
you have only 8-bit character data, which is essentially almost never.

Develop good habits when you start programming, that way you don't have to unlearn all the
bad habits later.

More below...  
On Sat, 12 Apr 2008 19:18:29 -0400, Joseph M. Newcomer <newcomer@flounder.com> wrote:

>On Sat, 12 Apr 2008 15:47:37 -0700, June Lee <iiuu66@yahoo.com> wrote:
>
>> Is that for Class/Object function prototype, I must define the
>>function in header file or .cpp file.
>>
>>MyClass::functionA();
>>MyClass::functionB();
>>
>>but for C function prototype, I don't have to define if it's put
>>before the main() function the following is not needed -
>>
>>void stradd (char *s1, char *s2);
>>void stradd (char *s1, int i);
>****
>First rule: forget the data type 'char' exists except in very rare and exotic situations,
>of which this is not one.  'char' is effectively obsolete for modern programming.
>
>void stradd(LPTSTR s1, LPTSTR s2);
>void stradd(LPTSTR s1, int i);
>
>Note that your fundamental design is flawed beyond redemption, because you are using
>strcat, which is now VERY obsolete and whose existence should be ignored.  It is unsafe.
>It should NEVER be used.
>
>The correct declarations for modern programming would be
>
>void stradd(CString & s1, const CString & s2);
>void stradd(CString & s1, int i);
>
>because CString is a correctly-handled type that can never have a buffer overrun when used
>correctly.
>
>Since you are clearly learning C, it is critical that you do NOT develop bad programming
>habits early.  Use of 'char', use of 'strcat', are now considered VERY BAD programming
>style.
>****
>>
>>=========
>>#include  <iostream> // cannot be iostream.h??
>>#include  <stdio.h>
>>#include  <string.h>
>>
>>
>>#include <comdef.h>
>>#include <conio.h>
>****
>You shoud not conio for anything; 
>****
>>#include <windows.h> // must need for SYSTEMTIME
>>
>>//must need C/C++ > General > Debug Information Format to debug
>>working
>>
>>using namespace std; // for cout must have??
>>
>>// concatenate two strings
>>void stradd (char *s1,  char *s2)
>>{
>>	strcat (s1, s2); // CRT <string.h> function
>****
>This is so unbelievably unsafe that no sane programmer would write this code today.  DO
>NOT use strcat!  It is UNSAFE.  
>****
>>}
>>
>>// concatenate a string with a "stringized" integer
>>void stradd (char *s1,  int i)
>>{
>>	char  temp[80];
>>
>>	sprintf (temp, "%d", i);
>>	strcat (s1, temp);
>****
>There are so many things wrong here it is mind boggling.  You are using 'char'.  You are
>using a fixed-size array; you are using sprintf, which is unsafe, and you are using
>strcat, which is unsafe.  The CORRECT way to write this code in MFC/ATL is
>	void stradd(CString & s1, int i)
>	    {
>                     CString s;
>	     s.Format(_T("%d"), i);
>	     s1 += s;
>                   }
>
>This is the only acceptable style of coding that should be used.  You can also use
>std::string, but CString is well-integrated into MFC and ATL and is the preferred class.
>But fixed-size buffers, strcat, strcpy, and sprintf should NEVER enter your programming
>vocabulary.  They are so bad that if they did not already exist, nobody would be dumb
>enough to create them!  (I thought they were a stupid idea in 1975 when I first discovered
>C, and guess what, 30 years later everyone seems to have made the same discovery!)
>****
>>}
>>
>>
>>
>>int main()
>>{
>>	//SYSTEMTIME st = {0,0,0,0,0,0,0,0}; // cannot divide into 2
>>lines - must init all in one line
>****
>The above comment is not true; it can be multiple lines!
>	SYSTEMTIME
>	    st 
>	      =
>		{
>		 0
>		 .
>and so on!
****
The C language treats newline as whitespace in ALL contexts except #define lines (where
you need to put a \ at the end of the line to cause the next line to be part of the
#define) and in quoted literals (where it is not permitted at all).  What you can't do is
an assignment of a structured type as a second assignment statement, because C has no
syntax to represent aggregate literals.  But that's not the same as saying the
initialization can't be divided into multiple lines.
>****
>>	SYSTEMTIME st = {0}; // OK too
>>
>>	char   str[80];
>>	//char* str; // not OK will crash program
****
Yes.  The declaration 'char * str' makes no sense, because it is an uninitialized pointer
to a string.  As such, it does not reference an actual string; you would have to allocate
space to hold the string, and assign a pointer to that space to this variable.  

It makes as much sense to code this as to write
	int i;
	i++;
what value do you think 'i' will have at this point?  Right, some unknown and unknowable
value, because i was never initialized in the first place, so adding 1 to an uninitialized
value will create a meaningless value.  char * str is essentially the identical problem.
Had you written
	char * str = (char *)malloc(80);
or
	char * str = new char[80];
it would work, except that you still have a fixed size buffer and the same errors apply
about buffer overrun, and then you have to additionally delete the buffer.
*****
>>
>>	strcpy (str, "Hello ");
>>	stradd (str, "there");
****
And then you do
	stradd(str, "this is a");
	stradd(str, "test of a very");
	stradd(str, "long string which is going to");
	stradd(str, "cause the buffer to overflow and");
	stradd(str, "totally destroy my execution");
and what happens?  (Never mind, I just explained it...).  This is why strcat is forbidden.
If you had use strcat_s, you would have written
	stradd(str, 80, "this is a");
	stradd(str, 80, "test of a very");
	stradd(str. 80, "long string which is going to");
and so on, then it would actually not overrun the buffer, and you would not have your
execution environment destroyed (your program will die with an access fault at some point,
perhaps on the return from the function, perhaps earlier, depending on what is destroyed).
*****
>>	cout << str << "\n";
>>
>>	stradd (str, 100);
>>	cout << str << "\n";
>>
>>	stradd (str, "hihi");
>>	cout << str << "\n";	
>>
****
The term for what you have done is officially "C programmer's disease" and is
characterized by creating buffers that are too small to hold the data.  (See: the Jargon
File).  It has been a defect in the C language since its creation, and there is no reason
to fall into the same trap that 30 years of C programmers fell into.  The best thing to
learn about the low-level CRT routines is when *NOT* to use them, and this is a prime
example of such a case
				joe
****
>>	return 0;
>>}
>>
>Joseph M. Newcomer [MVP]
>email: newcomer@flounder.com
>Web: http://www.flounder.com
>MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
4/13/2008 3:50:58 AM
Reply:

Similar Artilces:

How to build a project in Visual C++.net developed in Visual C++ 6
Hi, I am Nageshwar. I have developed a project in VC++ 6.0 and OpenGL. I have installed VC++.net in my system. When I compile and build the same code in VC++.net environment, I am getting errors. I have used fstream.h to read and write to files. But this header file is showing errors in VC++.net. I have used iostrea.h header. This is also showing erros. I think I need to use a different version of headers. Please suggest me how to recover from these errors. Which header file I have use instead of fstream.h header? etc., Thanks for all who help me.. Awaiting an early response, Nageshwar ...

C: Drive documents and setting expansion
Whenever I, Right Click Start then click "Explore", I get an expansion of the my user ID folders. Now, I rarely us "Documents and Settings" and would like to have it expand differently. What do I need to change so that can happen?? Thanks.. Bruce A. Julseth wrote: > Whenever I, Right Click Start then click "Explore", I get an > expansion of the my user ID folders. Now, I rarely us "Documents and > Settings" and would like to have it expand differently. > > What do I need to change so that can happen?? 1. You could ...

AVERAGEIF Function out there?
Is anybody out there aware of an "AVERAGEIF" function ?. I'm new to programming and have failed miserably trying to write it. Any help would be great. No need to write a function, you can use a combination of average and if as an example =AVERAGE(IF(Range=criteria,Range)) entered with ctrl + shift & enter Regards, Peo Sjoblom "davidad" wrote: > Is anybody out there aware of an "AVERAGEIF" function ?. > I'm new to programming and have failed miserably trying to > write it. Any help would be great. > davidad wrote: > Is any...

Create timeline for 2500 B.C. to 100 B.C.?
Visio only allows me to create timeline for after 1900 AD. Can I use Visio to create a timeline for 2500 BC to 100 BC? Visio's Divided timeline has exactly what I need except I can not enter BC as the start and end time. And Visio always require end time to be greater than the start time. Any suggestion on how I can do this in Visio? You're not going to be able to use the timeline because the code is linked to the system clock (only goes back to 1900). You'll have to use the vanilla shapes that come with visio. Al "Little Black Sheep" <Little Bl...

Visual C++ to read Strings from Serial Port
Hi. I'm doing a project using Visual C++ to read data from Serial Port. My program needs to do *something* when it receives specific data. For eg, if the program receives "Alarm 1 Zone 4", it will do something. The data received will be variable in length. My questions: 1) Any recommendations for the serial Comm Class for Visual C++? 2) How can i compare the data i receive from serial to the specific messages i'm looking for, eg data types, size of data types, limitations & etc.? Thanks. Any comments are highly appreciated. Leng As far as the serial part goes, it i...

C++ : Is it lots harder than c# and VB
Hi everyone, I learned Java whilst at university and have taught myself c# and VB.net. I think I am ok at it. I was thinking, these languages will probably be bigger in the future so I better get ready for them. But then, I also realised that COM is still quite important and so is C++. So I thought I better just try and have a look at C++ and COM. And now I'm scared. So my question is - why does C++ look so much harder than c#? For example : 1. The methods all have really stupid names that are hard to descern a function from. 2. You need to think about pointers and cleaning up ...

how i can use CEDitView member function
hi ,Can any one tell me that how i can use the CEditView member funcion ,if my VIEW CLASS IS DERIVED FROM CView instead of CEditView. for example void CTEST9View::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) { CEdit& theEdit = GetEditCtrl(); ------------------ ------------------ } But I am unable to get Get GetEditCtrl() ,so what i should do Arbind Mr David if u do not want to want tell, don't tell but don't do like this. "Arbind" <arbindb_tech@rediffmail.com> wrote in message news:e$WzWnVYDHA.1492@TK2MSFTNGP12.phx.gbl... > hi ,Can any one ...

C#.net windows application
Since I am new to c#.net 2008 but I have worked a little with visual basic.net 2005, I have the following questions I would like to ask: 1. When I am looking at a .sln file that I will be maintaining a work, I can see there are lots of static void Main() methods in a file called program.cs throughout the solution in separate folderts. Can you tell me the purpose of this kind of code? Does this instantiate an object, is this a class libary member? 2. When running the C#.net 2008 professional version windows application, how do I know which 'main' method is being called? ...

MFC DLL Calling C# Assembly
I have been trying to get a simple mfc dll I wrote to add to numbers call a C# assembly. Here is a sample of my C++ code in my cpp file. extern "C" _declspec(dllexport) int Calc(int no1,int no2) { //result = no1 + no2; return MangedAdder(no1, no2); } #pragma managed #using <mscorlib.dll> #using <ControllerLibrary.dll> int MangedAdder(int a, int b) { ControllerLibrary::DLLController *t = new ControllerLibrary::DLLController(); return t->AddNumbers(a, b); } All I really need is an extern function in a mfc dll that calls a me...

function not found in DLL
Specifically, at launching the main program, I get error window: “The procedure entry point ?function1@RTRTwrapper@@UAEXV$SomeStruct@M@@@Z could not be located in the DLL RTRT_dll.dll.” Basically, I have an interface class and a class that implements it built into a dll. In the example code below DLL_IMPORT_EXPORT is either _declspec(dllexport) at the DLL project, and _declspec(dllimport) when the DLL is used by the main project. Class DLL_IMPORT_EXPORT MyInterface { Virtual void function1(int param) = 0; Virtual void function2(int param) = 0; }; Class DLL_IMPORT_EXPORT MyClass : pu...

Advancing the Date Function?
Hi, I'm just looking for a function that looks at the previous cell, into which I've typed the date (in MM-yy format), and then simply advances it to the next month (i.e I type in Jan-10, then the next cell automatically displays Feb-10, and the one after Mar-10, etc). Sorry if this seems a simple request. Thanks As long as you typed in a real date, the format won't matter to excel -- it will matter to you! But if you have June 1, 2010 in A1 (formatted to 06-10), you can use this in B1: =date(year(a1),month(a1)+1,1) and format it the way you like. Ruper...

Distribution list causes "An internal support function returned an error"
Hello, I am using Outlook 2007 on XP Pro SP2. Every time I try to send a message using this one distribution list I get the error message "An internal support function returned an error". How can this be fixed? Recreate the DL from scratch. DL's are not reliable and never work for very long. -- Russ Valentine [MVP-Outlook] "BBran" <bbran@nowhere.com> wrote in message news:e5MYdzl5HHA.2208@TK2MSFTNGP06.phx.gbl... > Hello, > > I am using Outlook 2007 on XP Pro SP2. Every time I try to send a message > using this one distribution list I get ...

Changing the text within a function based on a cell reference.
I have multiple defined ranges that I called "List1", "List2".......... all the way to "List61". I could manually input the new lists names into the function everytime I fill down but this is a tedious job. I was wondering if there was a way to have a the function call a seperate cell to get the number and append it onto the defined range? This way when I do fill down the List name automatically changes with the contents of the referenced cell. Is this possible? Here is the function I am using.... {=SUM(IF(FREQUENCY(IF(LEN(List1)>0,MATCH(List1,List1,0),&qu...

TSQL replacements for Access Functions
Great article, wish someone had given me this a decade ago! http://www.databasejournal.com/features/msaccess/article.php/3865076/article.htm Thanks for sharing that link. Danny does a good job of summarizing. "a a r o n _ k e m p f" <aaron_kempf@Hotmail.com> wrote in message news:81d76203-063c-4e73-9973-b3d2a893c654@v20g2000prb.googlegroups.com... > Great article, wish someone had given me this a decade ago! > > http://www.databasejournal.com/features/msaccess/article.php/3865076/article.htm > "a a r o n _ k e m p f" <aaron_kempf@Ho...

Type Casting in C and C++
Hello NG As an old style programmer I've been casting values with the C-syntax like: double dVal=3.14; float fVal = (float) dVal; but now I've been told that the C++ syntax should do a better job float fVal = static_cast <float>(dVal); for some reason. Is this true? Will the C++ compiler really generate different (better?) code or is it simply more writing I have to do? Thanx Richie >As an old style programmer I've been casting values with the C-syntax like: > >double dVal=3.14; >float fVal = (float) dVal; > >but now I've been told that the C+...

Find Function
I would like to find the second occurence of a specific alphanumeric character in a cell. For example, if cell A1 contains "BOBBY" what would be the formula for finding the second occurence of the letter "B". Thank you advance for your assistance. Greatly appreciated =FIND("#",SUBSTITUTE(A1,"B","#",2)) Replace # by another symbol if it can be part of your text -- Kind regards, Niek Otten Microsoft MVP - Excel "SJT" <SJT@discussions.microsoft.com> wrote in message news:70B9153E-4351-4983-96D5-8870C633...

Sum Function
I did som research to the prior post, I am using this =Sum(IIf([Assigned]= "Carla",1,0) I have this in a text box, but is repeating itself for 12 - 13 pages with a total count of 453 posts. Is there a way to limit it to one entry? Thanks, Put your calculated text box in the report footer and hide the detail section. If you really don't need the detail records, change your Record Source to a totals query. -- Duane Hookom Microsoft Access MVP "lmossolle" wrote: > I did som research to the prior post, I am using this > =Sum(IIf([Assigned]= "Carla&quo...

deleting a non functioning account
I would like to close an account on Money.. yet keep the information available untill he end of the year for tax purposes. How can I move it so this account doesn't show up on my home page. In microsoft.public.money, Lstew wrote: >I would like to close an account on Money.. yet keep the >information available untill he end of the year for tax >purposes. How can I move it so this account doesn't show >up on my home page. From the Account List, right-click the account, and select Account Is Closed. Also un-check Favorite if that is checked. In the Change View on...

C# extension functions using MSXML?
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl. The question I haven't been able to find in these groups is can I use C# extension functions with the MSXML objects? More specifically to use a C# class which has all my extension functions. I've seen examples where the stylesheet uses the <msxsl:script> element and embeds C# code, but that's not a viable solution for my situation since I'll be maintaining lots of different stylesheets which require the same extension functions. (if ...

DateAdd Function 02-09-10
Hi Everyone, Using Access 2003. I have my query working....almost. I need to see patients who have been on therapy for more than 10 days. I have a field ThpyStDtTm and in my query grid, my Criteria is <=DateAdd("d",-10,Date()). This shows me all the records of therapy that is >10 days old. The problem is it is not showing me the records for that patient that are less than 10 days old and I need to see these records too but only for the patients on therapy more than 10 days. I am thinking I need to take the criteria off of my ThpyStDtTm field and add a ne...

Function Problem 12-07-07
Hello...ok I have a form with a button that I am trying to get to call on a function. I have been able to do this and the funtion processes but I keep getting an error. Now, the funtion works perfectly if I run it from the switchboard/menu, but when run from the form button I get this error: "The action or method requires a Table Name argument" Here is the code I have: Private Sub Update_All_Records_Click() On Error GoTo Update_All_Records_Click_Err DoCmd.OpenFunction Public_Income_Update_Step_1 Update_All_Records_Click_Exit: Exit Sub Update_All_Records_Click_Err: M...

What formula/function can I use?
I'm creating a spreadsheet for a client and I'm not sure what formula/function I need to do this: I created a table with over 500 available values. I then created (on a separate sheet) a form to input the customers information. 4 pieces of the customer's information need to be used to figure out the correct price - Age, Tobacco or No, Male or Female, and amount of coverage. I need to be able to reference the right cell in my table according to how the 4 above criteria are met, and plug that value back on to my customer information page to show the customer their cost for c...

User Defined Function or Function for Phase Duration
Sub GetPhaseDuration() Dim start As Date Dim Finish As Date Dim Duration As Integer Dim PhaseDuration As Integer For Each Task In active.Project.Tasks If Task.Summary Then PhaseDuration = Task.Summary.Duration End If If Not Task.Summary Then task.outlineparent.Duration End If End Sub I am trying to create a field that displays Phase duration or PhaseStart and PhaseFinish to use in a formula. I have read similar posts but I am a little rusty at VBA. I have used VBA in Word, Access and Outlook so hopefully with a little direction I can do this. Tha...

C, C++ and C# Forums
Throne Software has opened up C, C++ and C# Forums at: http://www.thronesoftware.com/forum/ Join us! ...

for some reason when i deploy my C# application on windows 2003 occasionaly rdr[0].ToString() hangs where rdr is a System.Data.SqlClient.SqlDataReader. Is there a fix for this? is my visual studio.net
for some reason when i deploy my C# application on windows 2003 occasionaly rdr[0].ToString() hangs where rdr is a System.Data.SqlClient.SqlDataReader. Is there a fix for this? is my visual studio.net out dated? Hi, 1. Does this seem to you to be the right Newsgroup to ask this question ? I would have suggested "microsoft.public.dotnet.framework.adonet". 2. Is there supposed to be a difference between the Message Subject and the Message body ? Isn't the Message Subject supposed to be abbreviated ? 3. As for your question : I strongly doubt if your VS.NET can be called "o...