|
Hello Moonen,
in some case is this a good idea, but i can't change all file content, because this change the file, and i want to extract some parts of this file and store it
in a new varable for later to compare and some other functions!
but tanx for reply
break;
|
|
|
|
|
break; wrote: Hello Moonen
It is Cedric or Mr.Moonen.
break; wrote: but i can't change all file content, because this change the file
What Cedric meant is that you can use a temporary string which you can manipulate as you wish to get the index returned by the Find function, and then use this index on the real variable, namely this one:
break; wrote: store it
in a new varable for later to compare
~RaGE();
|
|
|
|
|
uups, sorry
thanx
break;
|
|
|
|
|
You could derive a custom string class from CString and overload the Find function:
class CMyCString : public CString
{
int Find(LPSTR lpszSub, int startAt=0);
}
int CMyCString::Find LPSTR lpszSub, int startAt)
{
CString s1 = *this; //make a copy of the current string
CString s2 = lpszSub;
//Make both strings uppercase
s1.MakeUpper();
s2.MakeUpper();
return s1.Find(s2,startAt);
}
You would then be able to use your custom class in place of CString.
|
|
|
|
|
hello,
thanx for reply, i try your sample!
regards
break;
|
|
|
|
|
Heya everybody. I got a question about WM_NCHITTEST...
I got a window with thick border and to prevent the user to resize it, I have to interpret WM_NCHITTEST and return HTBORDER when the mouse is over the border. However... the question is... is there an easy way to know when the mouse is over the border??? Or do I have to make some arithmetical checks for this? As far as I see the problem right now, the only way to determine when the mouse is over a border is to calculate by using the lParam of WM_NCHITTEST which tells me screen-relative X/Y position.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
I did a test for you, add the 3 lines:
//===============================
CMenu*pMu=GetSystemMenu(0);
pMu->RemoveMenu(SC_SIZE,MF_BYCOMMAND);
ModifyStyle(WS_MAXIMIZEBOX,0);
//===============================
the window will not be sized.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Thank you. I don't know if this would work on WIN32 though, since I am not using MFC.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Use the return value of the base class OnNcHitTest.
MFC
UINT CMyWnd::OnNcHitTest(CPoint point)
{
UINT border = CWnd::OnNcHitTest(point);
switch (border)
{
case HT_BOTTOM:
border = HTBORDER;
break;
...
}
return border;
} Win32
LRESULT CALLBACK WndProc (...)
{
switch (nMsg)
{
case WM_NCHITEST:
{
UINT border = ::DefWindowProc(hWnd, nMsg, wp, lp);
switch (border)
...
Well, you get the idea
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Yeap, I got it. I should have thought at the DefWindowProc stuff. Hrmph *pissed off on self*.
Thank you.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
WM_NCMOUSEMOVE
Nibu thomas
Software Developer
|
|
|
|
|
Hello Everybody!
I'v got a following problem.
I have an bmp image.
With a help of GDI+ function I conver it to tiff file (pure C++ code).
Everything worked, but the problem that generated tiff file has 96 dpi
resilution, when I want 300 dpi.
Is enybody know the way how to specify resolution in GDI+
when converting images?
|
|
|
|
|
|
I've looked at MS documentataion and have found only folowing 3 parameters:
//=========================================
TIFF encoder parameter Allowable values:
- Compression EncoderValueCompressionLZW
- EncoderValueCompressionCCITT3
- EncoderValueCompressionCCITT4
- EncoderValueCompressionRle
- EncoderValueCompressionNone
ColorDepth : 1, 4, 8, 24, 32
SaveFlag : EncoderValueMultiFrame
//=================================
Nothing about dpi
|
|
|
|
|
I've solved the problem!
The Idea is using Gdiplus:: Bitmap
instead of Gdiplus::Image
In this case there is a function Bitmap->SetResolution(REAL x, REAL y)
that allow to do it.
|
|
|
|
|
here is what I want to do:
I want to swap the some elements of an array so I want to make a function like that:
int arr[] // this array is initialized
...
swap( int a[])
{
//swap parameters
}
swap(arr); // use the function
printarr(arr); // print the resault
The question is: how should I pass the array to the function properly, so that it changes the values of arr outside of its body too?
|
|
|
|
|
void swap (int* array) { }
|
|
|
|
|
Pass the array as a pointer.
void SwapArrayVals(int iVals[],int size){
}
and to call the function
int iData[2] = {11,22};
SwapArrayVals(iData,2);
or
int iData[2] = {11,22};
SwapArrayVals(&iData[0],2);
Also, it's not always necassary to pass the array size, but it is good practice and avoids writing outside your array.
|
|
|
|
|
Also, it could be interesting to have a look at the containers (particularly the vector) of the standard template library (STL). Basically, it will help you to maintain arrays that can be resized easily, ...
|
|
|
|
|
|
Hello all,
Am newly working with bitmap, i do have many questions regarding this.
At present am working on Visual C++, but am devolping code in C without any dialog based(No GUI), just with CLASS view and FILE view, am almost finished with the work, but the problem, now i have to open a bitmap to plot the output data on the bitmap.
Is it possible to create a Bitmap in C or should i use VC++ dialog based application only? Is there any special function?
|
|
|
|
|
Its possible to open a bitmap the same as any other "text" file. You can also use the CreateBitmap() LoadBitmap() ... functions, but I think these require that you include windows.h or at least GDI.h into your project.
I'm not sure exactly what you are rying to do, but if you do some research about DI (Device Independant) Bitmaps, these allow you to manipulate each pixel in the structure.
|
|
|
|
|
hello,
#include "windows.h"
#include "windgi.h"
#include "GDI.h"
CreateBitmap(100,100,256,16,const void*lpvbit);
am getting an error as "cannot open GDI.h"
what could be the reason?
|
|
|
|
|
Are u working on WIN32 console application?
|
|
|
|
|
ya, this is win32 console application.
|
|
|
|