|
I m using closeMovieFile(refnum),but still it is not deleting.
|
|
|
|
|
Hi Everybody,
I need a help regarding subclassing CRichEditCtrl....
I have create the class MyRichEditCtrl using base class as CRichEditCtrl. I want to override "SetSelectionCharFormat" function in my subclass. It has to do the same functionality as the base class function + more. Pls any one help.
vijay
modified on Wednesday, April 8, 2009 11:36 PM
|
|
|
|
|
BOOL MyRichEditCtrl::SetSelectionCharFormat(CHARFORMAT2& cf)
{
CRichEditCtrl::SetSelectionCharFormat(cf);
+ more
}
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I would like to select Window objects (Start, File, Close, Minimize, Maximize ...) as a real mouse, however I don't have a real mouse, but I can use my capture coordinate to move the mouse as the following:
SetCapture();
SetCursorPos(pos_X, pos_Y);
ReleaseCapture();
By any chance, when my pointer (pos_X, pos_Y) pointing at a Window object, can I invoke any command, event to do as Left/Right-Click like the real Left/Right mouse buttons?
Many thanks for any help.
|
|
|
|
|
|
Follow your links, now I am able to do what I ask for.
Thanks
|
|
|
|
|
use funtion to count this sum:
s=a1*a2+a2*a3+a3*a4+...
I did,but have error:
#include "stdafx.h"
#include<iostream>
#include<cmath>
using namespace std;
void sum(int a[],int n)
{
int sum;
sum=0;
for(int i=1;i<n;i++)
sum=sum+ a[i]*a[i+1];
cout<<"sum="<<sum<<endl;
}
int main()
{
int a[100];
int n;
cout<<"enter n:"<<endl;
scanf("%d",&n);
cout<<"enter numbers of array ";
for(int i=1;i<n;i++)
scanf("%d ",&a[i]);
sum(a[100],n);
getchar();
}
but when running, this error : error C2664: 'sum' : cannot convert parameter 1 from 'int' to 'int []'
can you help me edit that code .can you send me your answer into my email: doiphongba_ht2000@yahoo.com
thank you very much
|
|
|
|
|
That's because a[100] refers to the 101st item of a (which doesn't exist anyway). To refer to the array, just use a .
Just be aware that arrays in C/C++ do not carry any information regarding the size of the array - if you need to process variable size arrays, you need to specify the array size.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have Cstring a. If button1 is pressed a="1". If button1 is pressed again a=a+"1". Now i want this a to be converted into integer or double.
Thanks
|
|
|
|
|
_ttoi[^], _ttof[^]?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
for:
CString a="111"
double x=_ttoi[a] doesn't work..
1 thing more..
How to delete decimals and dot for decimals for double x with string.format(...,x)?
|
|
|
|
|
Aljaz111 wrote: CString a="111"
double x=_ttoi[a] doesn't work..
Function call syntax helps...this code (note - it's _tstof, not _ttof - MSDN is a little ambiguous here)
{
CString a("11");
const int i = _ttoi(a);
const double d = _tstof(a);
std::cout << i << std::endl;
std::cout << d << std::endl;
}
{
CString a("11.5");
const int i = _ttoi(a);
const double d = _tstof(a);
std::cout << i << std::endl;
std::cout << d << std::endl;
}
produces this
11
11
11
11.5
Aljaz111 wrote: How to delete decimals and dot for decimals for double x with string.format(...,x)?
Sorry, don't know what you mean.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Lets say you have double x= 5.0000... how to delete decimals so outcome would be double x=5 without .0000??
|
|
|
|
|
Do you mean when you use CString::Format ? I'd do it like this:
CString a;
double d = 5.0000;
a.Format("%d", (int)d);
i.e. cast it to an int and treat as an int.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
// DLL10.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include "DLL10.h"
static HHOOK hHook = NULL;
static HINSTANCE hInst;
BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
hInst = hModule;
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
// This is an example of an exported variable
DLL10_API int nDLL10=0;
// This is an example of an exported function.
DLL10_API int fnDLL10(void)
{
return 42;
}
// This is the constructor of a class that has been exported.
// see DLL10.h for the class definition
CDLL10::CDLL10()
{
return;
}
int getNumber()
{
return 1;
}
This is my DLL file, and When I load the file, DLLMain is not called?
|
|
|
|
|
How have you verified that DllMain isn't called?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Possibly he didn't hear the call...
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]
|
|
|
|
|
I set printf() in DllMain, but didn't show the result
and I set break point int DllMain.
|
|
|
|
|
ernst20020530 wrote: I set printf() in DllMain, but didn't show the result
Not a surprise
ernst20020530 wrote: I set break point int DllMain.
I presume you had a separate executable to run that referenced that DLL?
When I did that with your DLL code, I was able to break in the DllMain. I used this as the code for my executable:
int _tmain(int argc, _TCHAR* argv[])
{
LoadLibrary(_T("dll-name"));
return 0;
}
where dll-name is the name of the DLL I built.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi there,
I was wondering if there is any standard way to detect which version of Windows SDK is installed using macros. SDK 6.1 defines some function signatures a bit differently than the Platform SDK that ships with VC++ 2005. If there is such a trick, I was thinking of using the new function signature for the newer SDKs while still letting the the people without the windows sdk 6.1 compile. Or, is there a better way to handle this situation? Thanks in advance.
--
Regards,
- Tareq
|
|
|
|
|
tareqsiraj wrote: SDK 6.1 defines some function signatures a bit differently than the Platform SDK that ships with VC++ 2005
You mean the extra bits on parameters, like in this definition of CoInitializeEx ?
WINOLEAPI CoInitializeEx(__in_opt LPVOID pvReserved, __in DWORD dwCoInit);
They don't make any difference to the compiler - they're just macros that expand to nothing unless you're using Prefast[^].
Just #include things and don't worry about them.
tareqsiraj wrote: If there is such a trick, I was thinking of using the new function signature for the newer SDKs while still letting the the people without the windows sdk 6.1 compile
Not entirely sure what you mean there - as I said, just use the SDK headers and don't worry about what version they are unless they're too old for the version of Windows you're targeting and don't contain the functions you need.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Umm... thats not what I meant. For example, the dbghelp.h that ships with VS2005's PSDK uses PSTR for the first param of PENUMLOADED_MODULES_CALLBACK64 while the dbghelp.h that ships with SDK6.1 uses PCSTR. Now, I want both who does and doesn't have SDK6.1 to be able to compile the app. Hopefully this makes things a bit clear.
--
Regards,
-Tareq
|
|
|
|
|
Ah, right - hadn't noticed that before. Not quite as obvious as all the __in things on function parameters
Now, looking at the SDK headers (v6.0A), they use the macro CONST to add const-ness to SDK parameter specs.
So, you could do something like:
#include <Windows.h>
#ifndef CONST
#define CONST
#endif
and then use CONST instead of const ?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for spending some time on this... unfortunately, the PSDK that comes with VC++2005 does the same with CONST. So it will have the same effect regardless of SDK6.0+.
-Tareq
|
|
|
|
|
Hello,
I use the following to detect the version of Platform SDK/Windows SDK.
#include "ntverp.h"
#if !defined(VER_PRODUCTBUILD) || VER_PRODUCTBUILD < 3790
#pragma message ("********************************************"
#pragma message ("Error: You need the latest Microsoft Platform SDK to compile this project.")
#pragma message ("********************************************"
#endif
There are other constants defined in the header which may be of use to you. I believe my preprocessor directives above simply check that VER_PRODUCTBUILD is at minimum Platform SDK for Microsoft Windows Server 2003. There is another constant VER_PRODUCTBUILD_QFE which I *think* can determine patches and service packs.
Best Wishes,
-David Delaune
|
|
|
|