Does any one ever use function capFileSaveDIB?

I use VS .NET 2003. I had connected to a USB camera. I tried to
capture the image. The function capFileSaveDIB is used. MSDN said this
function would return true if successful. I call the function like
this:

int cameraCapture(HWND hWndofCap, CString pathCStr)
{
	char* pathStr = "";

	strcpy(pathStr, pathCStr.GetBuffer());
	pathCStr.ReleaseBuffer();

	if (capFileSaveDIB(hWndofCap, pathStr))
		return 1;
	else
		return 0;
}

I get the return value: 1. However, I don't get the picture where
pathCStr pointed. I don't understand.

Have you met this problem? I can't find out where the error is.

Thank You!
0
3/13/2008 2:29:32 AM
vc.mfc 33608 articles. 0 followers. Follow

13 Replies
1719 Views

Similar Articles

[PageSpeed] 38

"Andrew Chang" <laplacezhang@gmail.com> wrote in message 
news:e67989a4-3555-45d3-a82a-19f0f9599a89@d4g2000prg.googlegroups.com...
>I use VS .NET 2003. I had connected to a USB camera. I tried to
> capture the image. The function capFileSaveDIB is used. MSDN said this
> function would return true if successful. I call the function like
> this:
>
> int cameraCapture(HWND hWndofCap, CString pathCStr)
> {
> char* pathStr = "";
>
> strcpy(pathStr, pathCStr.GetBuffer());
> pathCStr.ReleaseBuffer();
>
> if (capFileSaveDIB(hWndofCap, pathStr))
> return 1;
> else
> return 0;
> }
>
> I get the return value: 1. However, I don't get the picture where
> pathCStr pointed. I don't understand.
>
> Have you met this problem? I can't find out where the error is.
>


You haven't allocated any memory for pathStr, yet you strcpy() into it.  Why 
don't you just avoid all that:

BOOL cameraCapture(HWND hWndofCap, CString pathCStr)
{
    return capFileSaveDIB(hWndofCap, pathStr);
}


-- David



0
dc2983 (3206)
3/13/2008 3:54:22 AM
"David Ching" <dc@remove-this.dcsoft.com> ha scritto nel messaggio 
news:Pz1Cj.416$p24.147@nlpi061.nbdc.sbc.com...

> You haven't allocated any memory for pathStr, yet you strcpy() into it. 
> Why don't you just avoid all that:
>
> BOOL cameraCapture(HWND hWndofCap, CString pathCStr)
> {
>    return capFileSaveDIB(hWndofCap, pathStr);
> }

To add to what David correctly wrote, I'd like to say that I would use const 
reference to pass the CString, like this:

 BOOL cameraCapture( ..., const CString & path )

In general, I think that when passing class instances (like CString's) using 
const reference for input values is a good technique (it saves you the 
creation of temporary objects and copy constructor calls typical of passing 
non-reference values - even if for the special case of CString it is less 
expensive than other cases, because CString seems to be reference counted).

Giovanni


0
3/13/2008 11:28:10 AM
On Mar 13, 11:54=A0am, "David Ching" <d...@remove-this.dcsoft.com>
wrote:
> "Andrew Chang" <laplacezh...@gmail.com> wrote in message
>
> news:e67989a4-3555-45d3-a82a-19f0f9599a89@d4g2000prg.googlegroups.com...
>
>
>
>
>
> >I use VS .NET 2003. I had connected to a USB camera. I tried to
> > capture the image. The function capFileSaveDIB is used. MSDN said this
> > function would return true if successful. I call the function like
> > this:
>
> > int cameraCapture(HWND hWndofCap, CString pathCStr)
> > {
> > char* pathStr =3D "";
>
> > strcpy(pathStr, pathCStr.GetBuffer());
> > pathCStr.ReleaseBuffer();
>
> > if (capFileSaveDIB(hWndofCap, pathStr))
> > return 1;
> > else
> > return 0;
> > }
>
> > I get the return value: 1. However, I don't get the picture where
> > pathCStr pointed. I don't understand.
>
> > Have you met this problem? I can't find out where the error is.
>
> You haven't allocated any memory for pathStr, yet you strcpy() into it. =
=A0Why
> don't you just avoid all that:
>
> BOOL cameraCapture(HWND hWndofCap, CString pathCStr)
> {
> =A0 =A0 return capFileSaveDIB(hWndofCap, pathStr);
>
> }
>
> -- David- Hide quoted text -
>
> - Show quoted text -

I don't write it that simple because I wanted it to be clear to
others.

There's a problem perhaps you did't noticed, the 2nd parameter of
function capFileSaveDIB should be an LPCTSTR type.
0
3/14/2008 7:27:03 AM
"Andrew Chang" <laplacezhang@gmail.com> ha scritto nel messaggio 
news:216f6fd0-c847-44ba-9e38-ed38df0254ed@h11g2000prf.googlegroups.com...

> There's a problem perhaps you did't noticed, the 2nd parameter of
> function capFileSaveDIB should be an LPCTSTR type.

Andrew: CString is a well designed class, and the designers thought about 
that issue, so they implemented a LPCTSTR operator in CString [*], which 
performs implicit cast (= conversion) from CString to LPCTSTR.
i.e. in every place in a method or function signature that you read LPCTSTR, 
you can use there a CString instance (or const CString &).

However, I'd like to point out that not everyone agree with using *implicit* 
cast operators.
Others prefer an explicit converison (like calling the .c_str() method in 
STL string classes).

[*] In VC9 this operator LPCTSTR is actually defined (as operator PCXSTR) in 
CSimpleStringT, a base class for CString template.

Giovanni


0
3/14/2008 10:20:43 AM
"Andrew Chang" <laplacezhang@gmail.com> wrote in message 
news:216f6fd0-c847-44ba-9e38-ed38df0254ed@h11g2000prf.googlegroups.com...
> I don't write it that simple because I wanted it to be clear to
> others.
>
> There's a problem perhaps you did't noticed, the 2nd parameter of
> function capFileSaveDIB should be an LPCTSTR type.

I think if a programmer isn't familiar with how CString works, they may 
scratch their head as to why you can pass a CString to a parameter that uses 
LPCTSTR.  But if it compiles (and it does), it should be somewhat obvious as 
to what it does.  I think manually copying the contents of the CString to a 
character buffer should be avoided as it is error prone (e.g. your code 
forgot to allocate/deallocate the buffer) and not future proof (e.g. your 
code doesn't work with UNICODE), and all that code confuses the reader from 
seeing that all your function does is call capFileSaveDIB().

BTW, did it actually save the file after fixing this problem?

-- David


0
dc2983 (3206)
3/14/2008 11:56:29 AM
On Wed, 12 Mar 2008 19:29:32 -0700 (PDT), Andrew Chang
<laplacezhang@gmail.com> wrote:

>I use VS .NET 2003. I had connected to a USB camera. I tried to
>capture the image. The function capFileSaveDIB is used. MSDN said this
>function would return true if successful. I call the function like
>this:

It's not a function, it's a macro for a Windows message, and to understand
how to use it, you have to look up the message, WM_CAP_FILE_SAVEDIB.

>int cameraCapture(HWND hWndofCap, CString pathCStr)
>{
>	char* pathStr = "";
>
>	strcpy(pathStr, pathCStr.GetBuffer());
>	pathCStr.ReleaseBuffer();

This is wrong for several reasons:

1. The variable pathStr points to the first character of a string literal,
and it is undefined to write to string literals, which is what you're doing
with strcpy. I'm surprised you didn't get an access violation.

2. You don't need to use GetBuffer/ReleaseBuffer. You can just use
pathCStr, and CString's operator LPCTSTR will perform the conversion to
char* in an ANSI program.

3. In a Unicode program, CString will be Unicode and consist of an array of
wchar_t, not char, and you can't copy it with strcpy. In fact, your code
won't compile.

>	if (capFileSaveDIB(hWndofCap, pathStr))
>		return 1;
>	else
>		return 0;
>}
>
>I get the return value: 1. However, I don't get the picture where
>pathCStr pointed. I don't understand.
>
>Have you met this problem? I can't find out where the error is.
>
>Thank You!

Reviewing the documentation for WM_CAP_FILE_SAVEDIB, I find:

wParam = (WPARAM) 0; 
lParam = (LPARAM) (LPVOID) (LPSTR) (szName); 

The initial cast to LPSTR indicates you need to provide it with a
char-based string. While the documentation doesn't state it, presumably
Windows treats szName as a constant string, so you should be able to pass
plain old CString in ANSI programs or CStringA in either ANSI or Unicode.
(I don't know why they have that middle cast to LPVOID; it doesn't
accomplish anything.) If you wanted to play it safer, this would be the
time to use GetBuffer/ReleaseBuffer, and if you wanted to rule out any
possibility of Windows messing with your string, copy it to a vector<char>,
CArray, or in recent versions of VC++, CStringA. In a Unicode program, if
you wanted to control the code page for the conversion from wide to narrow
string, I believe you'd have to use WideCharToMultiByte.

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
3/14/2008 4:05:46 PM
"Doug Harrison [MVP]" <dsh@mvps.org> ha scritto nel messaggio 
news:hf7lt39s2cb334uvjvf8crtmk4q1ca12t0@4ax.com...

> Reviewing the documentation for WM_CAP_FILE_SAVEDIB, I find:
>
> wParam = (WPARAM) 0;
> lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
>
> The initial cast to LPSTR indicates you need to provide it with a
> char-based string. While the documentation doesn't state it, presumably
> Windows treats szName as a constant string, so you should be able to pass
> plain old CString in ANSI programs or CStringA in either ANSI or Unicode.

Hi Doug,

I read Vfw.h, and I read how capFileSaveDIB macro is defined:

#define capFileSaveDIB(hwnd, szName)   ((BOOL)AVICapSM(hwnd, 
WM_CAP_FILE_SAVEDIB, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))

There is an explicit cast using LP*T*STR (= TCHAR pointer).

I also read in that file that there are two distinct messages defined, for 
ANSI (A suffix) and Unicode UTF-16 (W suffix) implementations of the 
message:

#define WM_CAP_FILE_SAVEDIBA           (WM_CAP_START+  25)
#define WM_CAP_FILE_SAVEDIBW           (WM_CAP_UNICODE_START+  25)

And there is also:

#ifdef UNICODE
....
#define WM_CAP_FILE_SAVEDIB             WM_CAP_FILE_SAVEDIBW
#else
....
#define WM_CAP_FILE_SAVEDIB             WM_CAP_FILE_SAVEDIBA
#endif

So, I think that writing:

 lParam = (LPARAM) (LPVOID) (LPSTR) (szName);

is not correct; you should have a LPTSTR (TCHAR based) not LPSTR.

So, how WM_CAP_FILE_SAVEDIB expands (_A or _W) actually depends on the 
definition of UNICODE preprocessor label.

So, I don't agree neither with casting to LPSTR nor with using CStringA.

I think that if you want to use CStringA, you should also be explicit about 
using the _A form of the message, i.e. WM_CAP_FILESAVEDIBA (and in that case 
you shouldn't use capFileSaveDIB, because it is TCHAR-based).

IMHO, the best thing to do is to write Unicode aware code, so just use 
CString and LPTSTR, and if we want Unicode builds we can set them as Mihai 
explains in his blog.


> possibility of Windows messing with your string, copy it to a 
> vector<char>,
> CArray, or in recent versions of VC++, CStringA.

As I wrote, I beg to differ. I would use vector< TCHAR > or CString...

> In a Unicode program, if
> you wanted to control the code page for the conversion from wide to narrow
> string, I believe you'd have to use WideCharToMultiByte.

Instead I believe the OP doesn't need to convert from wide to narrow... 
WM_CAP_FILESAVEDIB can use UTF-16 as well.

Please correct me if I'm wrong.

Thanks,
Giovanni


0
3/14/2008 8:54:02 PM
On Fri, 14 Mar 2008 21:54:02 +0100, "Giovanni Dicanio"
<giovanni.dicanio@invalid.com> wrote:

>Hi Doug,
>
>I read Vfw.h, and I read how capFileSaveDIB macro is defined:
>
>#define capFileSaveDIB(hwnd, szName)   ((BOOL)AVICapSM(hwnd, 
>WM_CAP_FILE_SAVEDIB, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
>
>There is an explicit cast using LP*T*STR (= TCHAR pointer).
>
>I also read in that file that there are two distinct messages defined, for 
>ANSI (A suffix) and Unicode UTF-16 (W suffix) implementations of the 
>message:
>
>#define WM_CAP_FILE_SAVEDIBA           (WM_CAP_START+  25)
>#define WM_CAP_FILE_SAVEDIBW           (WM_CAP_UNICODE_START+  25)
>
>And there is also:
>
>#ifdef UNICODE
>...
>#define WM_CAP_FILE_SAVEDIB             WM_CAP_FILE_SAVEDIBW
>#else
>...
>#define WM_CAP_FILE_SAVEDIB             WM_CAP_FILE_SAVEDIBA
>#endif
>
>So, I think that writing:
>
> lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
>
>is not correct; you should have a LPTSTR (TCHAR based) not LPSTR.
>
>So, how WM_CAP_FILE_SAVEDIB expands (_A or _W) actually depends on the 
>definition of UNICODE preprocessor label.
>
>So, I don't agree neither with casting to LPSTR nor with using CStringA.
>
>I think that if you want to use CStringA, you should also be explicit about 
>using the _A form of the message, i.e. WM_CAP_FILESAVEDIBA (and in that case 
>you shouldn't use capFileSaveDIB, because it is TCHAR-based).
>
>IMHO, the best thing to do is to write Unicode aware code, so just use 
>CString and LPTSTR, and if we want Unicode builds we can set them as Mihai 
>explains in his blog.
>
>
>> possibility of Windows messing with your string, copy it to a 
>> vector<char>,
>> CArray, or in recent versions of VC++, CStringA.
>
>As I wrote, I beg to differ. I would use vector< TCHAR > or CString...
>
>> In a Unicode program, if
>> you wanted to control the code page for the conversion from wide to narrow
>> string, I believe you'd have to use WideCharToMultiByte.
>
>Instead I believe the OP doesn't need to convert from wide to narrow... 
>WM_CAP_FILESAVEDIB can use UTF-16 as well.
>
>Please correct me if I'm wrong.

Obviously, I committed a grievous mistake by taking MSDN seriously as
documentation:

capFileSaveDIB
http://msdn2.microsoft.com/en-us/library/ms707191(VS.85).aspx

WM_CAP_FILE_SAVEDIB
http://msdn2.microsoft.com/en-us/library/ms713788(VS.85).aspx

Moral: Just because Google can find stuff in MSDN doesn't make MSDN right.

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
3/14/2008 9:03:53 PM
"Doug Harrison [MVP]" <dsh@mvps.org> ha scritto nel messaggio 
news:arplt35cvkq5u37fo8pcgk25op7bag03h7@4ax.com...

> Obviously, I committed a grievous mistake by taking MSDN seriously as
> documentation:
[...]

Doug: I believe you did *not* commit mistake. It's MSDN's fault!

We should trust the documentation... if we can't trust it, what is the 
purpose of documentation? To lead the reader towards making errors?

I think you may add a MSDN community note to explain their blunder.

BTW: it seems that the header files are the only ones to trust...

Giovanni


0
3/14/2008 9:14:43 PM
On Mar 15, 12:05=A0am, "Doug Harrison [MVP]" <d...@mvps.org> wrote:
> On Wed, 12 Mar 2008 19:29:32 -0700 (PDT), Andrew Chang
>
> <laplacezh...@gmail.com> wrote:
> >I use VS .NET 2003. I had connected to a USB camera. I tried to
> >capture the image. The function capFileSaveDIB is used. MSDN said this
> >function would return true if successful. I call the function like
> >this:
>
> It's not a function, it's a macro for a Windows message, and to understand=

> how to use it, you have to look up the message, WM_CAP_FILE_SAVEDIB.
>
> >int cameraCapture(HWND hWndofCap, CString pathCStr)
> >{
> > =A0 =A0char* pathStr =3D "";
>
> > =A0 =A0strcpy(pathStr, pathCStr.GetBuffer());
> > =A0 =A0pathCStr.ReleaseBuffer();
>
> This is wrong for several reasons:
>
> 1. The variable pathStr points to the first character of a string literal,=

> and it is undefined to write to string literals, which is what you're doin=
g
> with strcpy. I'm surprised you didn't get an access violation.
>
> 2. You don't need to use GetBuffer/ReleaseBuffer. You can just use
> pathCStr, and CString's operator LPCTSTR will perform the conversion to
> char* in an ANSI program.
>
> 3. In a Unicode program, CString will be Unicode and consist of an array o=
f
> wchar_t, not char, and you can't copy it with strcpy. In fact, your code
> won't compile.
>

Reason 1: Sorry, I don't actually understand what you meant. I am
using VS .NET 2003. I hear that VS .NET 2005 makes it stricter to
transfer strings, did you mean that?

Reason 2: When I just use the pathCStr, I got the error. Compiler told
me it couldn't convert CString to LPCTSTR.

Reason 3: That could be a problem I haven't noticed. I'll try that
after I go back to my office. Thank you.
0
3/15/2008 1:44:16 AM
On Mar 14, 7:56=A0pm, "David Ching" <d...@remove-this.dcsoft.com> wrote:
> "Andrew Chang" <laplacezh...@gmail.com> wrote in message
>
> news:216f6fd0-c847-44ba-9e38-ed38df0254ed@h11g2000prf.googlegroups.com...
>
> > I don't write it that simple because I wanted it to be clear to
> > others.
>
> > There's a problem perhaps you did't noticed, the 2nd parameter of
> > function capFileSaveDIB should be an LPCTSTR type.
>
> I think if a programmer isn't familiar with how CString works, they may
> scratch their head as to why you can pass a CString to a parameter that us=
es
> LPCTSTR. =A0But if it compiles (and it does), it should be somewhat obviou=
s as
> to what it does. =A0I think manually copying the contents of the CString t=
o a
> character buffer should be avoided as it is error prone (e.g. your code
> forgot to allocate/deallocate the buffer) and not future proof (e.g. your
> code doesn't work with UNICODE), and all that code confuses the reader fro=
m
> seeing that all your function does is call capFileSaveDIB().
>
> BTW, did it actually save the file after fixing this problem?
>
> -- David

I use LabVIEW to call the dll. In LabVIEW, it use the type "CStr" to
transfer string parameters. Obviously it is CString in MFC. That is
why I use CString instead of LPCTSTR.

Now I directly use the char* as parameter to transfer path string and
I made it. However, I hadn't noticed the UNICODE problem, I just used
the simple path such as "C:\TempFile.bmp".

BTW: I found I had made a stupid mistake: I didn't successfully call
this dll. I was using LabVIEW to call this dll. But this is not
important to my question.

0
3/15/2008 1:54:26 AM
> 
> Reason 2: When I just use the pathCStr, I got the error. Compiler told
> me it couldn't convert CString to LPCTSTR.

No, the error was:cannot convert from 'ATL::CString' to 'LPTSTR'

You don't need cameraCapture, you can just:

capFileSaveDIB( hWndofCap, (LPCTSTR)pathCStr );


Best, Dan.
0
public21 (290)
3/15/2008 2:38:33 AM
On Fri, 14 Mar 2008 18:44:16 -0700 (PDT), Andrew Chang
<laplacezhang@gmail.com> wrote:

>> >int cameraCapture(HWND hWndofCap, CString pathCStr)
>> >{
>> > � �char* pathStr = "";
>>
>> > � �strcpy(pathStr, pathCStr.GetBuffer());
>> > � �pathCStr.ReleaseBuffer();
>>
>> This is wrong for several reasons:
>>
>> 1. The variable pathStr points to the first character of a string literal,
>> and it is undefined to write to string literals, which is what you're doing
>> with strcpy. I'm surprised you didn't get an access violation.
>>
>> 2. You don't need to use GetBuffer/ReleaseBuffer. You can just use
>> pathCStr, and CString's operator LPCTSTR will perform the conversion to
>> char* in an ANSI program.
>>
>> 3. In a Unicode program, CString will be Unicode and consist of an array of
>> wchar_t, not char, and you can't copy it with strcpy. In fact, your code
>> won't compile.
>>
>
>Reason 1: Sorry, I don't actually understand what you meant. I am
>using VS .NET 2003. I hear that VS .NET 2005 makes it stricter to
>transfer strings, did you mean that?

No, I meant what I said. At best, you're going to corrupt whatever follows
the string literal in memory, especially when your string literal is only 1
char long! VC++ normally places string literals in read-only memory, so
this can't happen, and you get an access violation instead. I'm pretty sure
this was true even in VC6, so you must not be using the /GF compiler
option. See:

http://msdn2.microsoft.com/en-us/library/s0s0asdt(VS.80).aspx

http://support.microsoft.com/kb/198477

>Reason 2: When I just use the pathCStr, I got the error. Compiler told
>me it couldn't convert CString to LPCTSTR.

What was the exact error message?

>Reason 3: That could be a problem I haven't noticed. I'll try that
>after I go back to my office. Thank you.

The only way your strcpy call doesn't compile simply by passing pathCStr is
due to CString being Unicode.

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
3/15/2008 4:18:44 AM
Reply:

Similar Artilces:

What's happened to the findfirst function in Access 2010?
I have a working Access 2007 Application which is now failing miserably in 2010. It hinges on location the first available working document in a table runing the following VBA code: With Me.Recordset .FindFirst "([fld1] + [fld2]) = 0" If .NoMatch Then .FindLast "([fdl1] + [fld2]) <> 0" Exit Sub End If .... FURTHER PROCESSING ... What must I do to correct this? Go through a record by record search? End With In 2007, this works correctly, stopping at the appropriate record (approc. rec 1385 in the recordset...

Using mouse wheel in VB editor
Just tried using the mouse wheel to scroll within visual basic editor in excel but it wont let me. How can I turn this feature on. I am using Excel 2003. Thanks in advance. This is a known problem with the latest MS mouse drivers. You can either install version 4 of the drivers (current version is 5), or use FreeWheel, and freeware program at http://www.geocities.com/SiliconValley/2060/freewheel.html . -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "fullers" <fullers@discussions.microsoft.com> wrote in message ne...

Send to certain person using specific email account
I send an email to a certain receipient but don't want to use the default email account. Is it possible that when I send to them (plain text) , that it will choose the other account I want to use to send it? Please advise how I set this up. Thanks. I do not believe that this can be achieved automatically through standard use of Outlook as you need to manually specify the name of the account to send from if different than the default. However, it would be possible using the Outlook object model. An Addin would need to be developed that monitored each mail item prior to sending. If the d...

OWA jumping mouse
I have two computers on my network that are having an interesting issue. When they are creating a message and typing away in the body of the message, randomly when they hit a key, any key, they system will act as if the mouse was clicked. If the mouse is over the send button, it would have sent the email. If the mouse was over the start button, the start menu would have come up. Where ever the mouse was left at, it will act as if it was clicked. It is very random but often. This only happens in OWA, not in outlook or any other place. Both systems are running XP pro SP2 with IE 6 SP2. ...

Use exchange from a trusted domain
Hi folks, I have domain a and domain b. Domain a is all set upp with exchange etc. Domain b was bought, and they don't have exchange. I have trust between the domains and file sharing and authentication are ok. What we want to do is, make users on domain b and let them use the exchange (on a seperate storage) on domain a. The users on domain b must logon to domain b, but need to have mailbox on domain a. Domain a are running on win2003 and exchange 2003. Domain are running on win2003 with forest and domain ready for exchange. Any advices? thanks in advance, - Bjarni Hi, Thi...

changing values of one field based on another
How can I best change the values of one field in a table based on values of another field of the same table. We have an existing table of thousands of entries and I would like to use the following logic to populate a new boolean field. If field1 = "Done" Then BooleanFieldCompleted = True I have some Excel VBA experience but limited Access. I dont want to do this manually! Any assistance appreciated. In general, you'd use an Update query. However, in this case I don't see why you'd need such a field. Why not just create a query with a computed field that returns True...

Qrp Date functions
Where do I find the various functions to modify the Reports like cast(DatePart(Dd,[Transaction].Time) as nvarchar) and others and what they mean???? Barry Found the information at MSDN Transact-SQL Reference Barry "Barry L" <barryl@eryanjewelers.com> wrote in message news:usd3uP1CIHA.1188@TK2MSFTNGP04.phx.gbl... > Where do I find the various functions to modify the Reports > like cast(DatePart(Dd,[Transaction].Time) as nvarchar) and others > and what they mean???? > > Barry > ...

Using Access 2003 on client to see Sharepoint 2007
Testing a Sharepoint environment and I can easily manipulate and run the database from Access 2007, but when I try to use Access 2003 it wants me to save the database to a location. The Access 2003 has the compatiblity pack, but it seems to not work when I download it. So the question is using Sharepoint 2007 and posting the Access 2007 format to it, can a user go to the sharepoint site and use a 2003 Access database that has the compatibility pack and open without having to download it? -- Message posted via http://www.accessmonster.com Send check for $500.00 to: David A Jenn...

Copying Data in a cell in one sheet to a cell in another sheet
I've run into a problem trying to copy data from a cell in one sheet to another. I have a spreadsheet called "rating" which contains a number of formula that calculates a final number. I also have a spreadsheet called "Final" that copies over the information from "Rating". In "Final", I'm trying to copy a number from "Rating" into a particular cell. I put in =Rating! G89, but it won't work. When I press enter, a window pops up "Update value:Rating". I press enter again and in the cell where I want the number ...

Some Excel formatting functions taking a long time to work #2
Excel 2000 SP3 When I use some formatting functions for the first time in a session, such as bold, increasing font size etc, it takes up to 30 seconds to work. Meantime Excel is locked up until it completes that formatting call. I suspect faulty DLL? Has anyone experienced this? How to fix (other than a complete re- install) ? Any advice appreciated. Piri On Nov 5, 8:39=A0am, Piri <wiremu.pare...@hotmail.com> wrote: > Excel 2000 SP3 > When I use some formatting functions for the first time in a > session, such as bold, increasing font size etc, it takes =A0up to 30 > secon...

How Use ShellExecute with a CMemFile
Hello, I need to store files of various types (such as .doc, .xls, .jpg, .pdf, ..wmv, ...) in a database. Upon retrieval of such a file I have the file as data in memory in a CMemFile. I need to then "display" the file in the aproriate application. If I were to write the CMemFile to disk and create an actual file I could then, of course, use ShellExecute() to launch , say Word to display a .doc file. However, I would much prefer to avoid the overhead of writing the data to an actual file and then dealing with having to detect when the User is done and cleaning up the file I had ...

Can i use conditional formating on a cell when it contains a formula?
I am trying a "conditional formatting" on a cell that contains formula, but it didn't work. "If cell value is equal to 0 then font - white" This doesn't work, stays always. If i use this condition on a cell without formula it works just fine. Thank -- si ----------------------------------------------------------------------- sit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=262 View this thread: http://www.excelforum.com/showthread.php?threadid=26784 Hi are you sure your formula returns an exact zero?. Could you post the formul...

Adding a Macro to a VLookup Function
In Excel 2000 -- I would like to create a summary spreadsheet (sheet2). For each time that "Name" appears in sheet 1, row *, take information from the same row, but columns 2 and 6 and bring it over to sheet 2 in the designated area. I know that you need to do a "VLookup" function and I got that to work. I know that you also need a "Loop" statement, so that it will continue to perform the Vlookup and bring over the information for each time that the name appears. I don't know how to write the formula so that the VLookup and the Loop are combined. Examp...

Using INDIRECT within functions
I learned a bit from JLathman in a previous post but tried to use the same methodology with this formula (also learned from this Group to get the last entered value in a column) without much luck. The original formula was this with 2009 sheet being static: =LOOKUP(2,1/('2009'!H3:H65536<>""),'2009'!H3:H65536) Trying to make it dynamic I tried the following without success: =LOOKUP(INDIRECT("2,1/(" & O1 & "!$H$3:$H$65536<>"")," & O1 & "!$H$3:$H$65536)")) Did I miss something or are...

Date function quit working
Hi, I have an Access 2002 application that I have been running on Windows XP SP2 without issue. I just installed the application (running in Access Runtime) on a Windows Vista Home Premium machine. Now, anywhere I used the =Date() function, it fails and just shows #Name? I also have a subform on one of my forms that has now gone blank. It also uses the date function. I had this problem when I converted to Windows XP several years ago and updating the OWC10.dll to version 6619 fixed both issues. However, everything I have read says that reference file makes no difference to the Access...

total group & max function
I am using Access 2003 I created a Db for Machine Mtce. The table consists of 3 tables, (1) Basic Mach Infor (ie Mach#, Mach Name, Mfg etc) - (2) Operations Table - consists of different prev mtce (PM) that need to be completed at various time frames. Ex: "Mach 100" could have 3 different operations; Oper # 100A to change the oil due every 90 days, Oper # 100B to check the belts due every 180 days, Oper # 100C to grease the machine due every 365 days. The 3rd table is the "PM History" table which includes the history of all of the PM's completed with Work Order...

Cant read one instance of recurring appointment
The problem we're having is a little different that what I've seen posted. A user randomly gets the message "Cant read one instance of recurring appointment. close any open appointments and try again, or recreate the appointment" several times a day. When you click OK the same message appears several times. Outlook doesn't indicate which recurring appointment is having the problem and the message just pops up at various times even if the user isn't in the calendar. We've deleted the Frmcache file and run the clean profile switch, but that hasn't worked. Has an...

Function to determine Directory Size
I'd like to be able to determine the size of a directory or group of files. Does anyone know of an add-in that has a function whereby I can specify a path and get the size of directory of groups of files as the return value? Ex: =dirsize("C:\Documents and Settings\Bob\My Documents\School") =dirsize("C:\Documents and Settings\Bob\My Documents\School\*.doc") It would also be helpful if there were an option to include subdirectories. -- Thanks, Bob Chmara Argh.... Make that "get the size of a directory or group of files" Bob "Bob Chmara" fatfing...

Help with simple(?) VBA function
I'm trying to selectively BOLD cells by the use of a User-Defined function. No joy. The VBA Help topics suggest something like this: Function Bold() Worksheets("Sheet1").Range("A1:A5").Font.Bold = True End Function When I try to use it the referenced cells are not changed and the function returns "0". Can anyone point this VBA neophyte in the right direction? Thanks, -Dick- Hi Dick, A function can only return a value. Macros and Functions (Macros as Opposed to Functions) http://www.cpearson.com/excel/differen.htm If all...

Excel Text Function (Right, Left)
My sheet has columns like this A 1. 63mmx 4kg 2. 75mmx 4kg SWR How can i detect that if a1:a2 is right,3 "swr", that it should be returned 3 otherwise 6. How can i add =right function with conditional formula. Help me Rao Ratan singh Hi =IF(RIGHT(A1,"SWR"),3,6) fill down your column (move cursor over bottom right hand corner of the cell when you see a +, double click) -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Rao Ratan Singh" <RaoRatanSingh@discussions.microsoft.com> wrote in message news:D...

Determine a result of one column based on conditions in two column
Example Col A Col B Count the number of a's in Col B only when an x is in Col A x a x a Result should be 2 y a z p I can't figure it out x t x m Thanks try this =SUMPRODUCT(--(A2:A7="x"),--(B2:B7="a")) -- Hope this help Please click the Yes button below if this post have helped answer your needs Thank You cheers, francis "tel703" wrote: > Example > Col A Col B Count the number of a...

Weekday function
Does VBA have a function which accepts an integer input between 1 and 7, which returns a string value to represent the corresponding day of the week?? For example, if you give the function an integer value of 1, then it should give back a string of "Sunday"... and the number 7 should return "Saturday". I know I can easily write my own function, but I'm curious if VBA provides a function already. No need for me to reinvent the wheel. thank you Don't think so, you would need to write one Function MyWeekDay(DayNum As Long) As String Dim Days A...

Exchange 2003, Two Sites, Two Smarthosts, One Domain, No Internal mail!!
Hi, I hope there is someone out there who can point me in the right direction. We have two sites, Brisbane and Sydney, connected by a frame realy connection. Sydney is currently running exchange 2003 (upgraded by migration from exchange 5.5 about a month ago). Brisbane is currently running their mail through sendmail and sendmail only. We have just installed exchange 2003 on server 2003 box in Brisbane and are trying to get the two sites working in two routing groups. The topology will be the same in both Brisbane and Sydney, in that each city will have an external mail server running sendma...

copy values generated by conditional formula in one sheet to the other work sheet as values
Hi Everybody, I have data generated by conditional formulae in work sheet1 in columns A to J. If the condition is satisfied the cell will display a realnumber, if the condition doesn't satisfied the cell will display the text"FALSE". Now I wanted to copy the cells which have the real numbers in sheet1 to sheet2 as values(as we do with paste special and paste the values) Do we have any formula or other method to copy the cells in sheet1 to sheet2. can anybody helpme out in this issue. Thanks and Regards Ramana Select your range to copy edit|goto|special|c...

How to use count for calls per hour
I am trying to create a pivot table and chart that will show me the # of calls per hour by day for a range of dates Aug 1 - Sept 19. My data looks like this where each line is the date and time of the call: How do I get a count of the # of the calls per hour by day? 8/1/08 12:48 AM 8/1/08 1:53 AM 8/1/08 2:36 AM 8/1/08 3:24 AM 8/1/08 3:37 AM 8/1/08 4:04 AM 8/1/08 4:44 AM 8/1/08 4:55 AM 8/1/08 4:58 AM 8/1/08 7:02 AM 8/1/08 7:28 AM 8/1/08 7:43 AM 8/1/08 7:47 AM 8/1/08 7:56 AM 8/1/08 7:58 AM 8/1/08 8:13 AM 8/1/08 8:33 AM 8/1/08 9:07 AM 8/1/08 10:28 AM 8/1/08 10:38 AM 8/1/08 10:44 AM 8/1/08 ...