|
Oh no, we are translating VB to C++, but the generated C++ code is left aligned, not indented, for loops being on 1 line...so its dirty...thats the reason we need the beautifier.
Any clue on which is a good one out on web?
|
|
|
|
|
oh, sorry now i understand... lol
hem, tell me, why don't you write a little console program that get your source, and that return you a "beautiful" code ?
it might take few lines i think...
otherwise, nop, i don't have any idea about what you're looking for.
TOXCCT >>> GEII power
|
|
|
|
|
I have used indent++ several years ago, and it was nice, although requiring some tuning. But I could not find it's home page now. But quick google bought me these links, I will appreciate, if you post results of your testing here
http://www.ochresoftware.com/sourcestyler-overview.html (not-free)
http://www.geocities.com/~starkville/main.html
http://perso.club-internet.fr/cbeaudet/
http://users.erols.com/astronaut/vim/tarfiles/ccb-1.07.tar.gz
http://www.uvm.edu/~ashawley/c/indent/
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
Thanks, will take a look at the links.
But basically I need some reliable (not too old)
beautifier, which is being maintained regularly bcoz I have to ship the beautifier with my product.
|
|
|
|
|
Load the file in Visual C++ editor ver 6( i dont know about .net studio),
press ctrl^a to select all of the code, and the press
alt-F8
voila you code is beautifull.
|
|
|
|
|
VC++ ver6 wont help bcoz I need to hook up this beautifier in my project and also would need to ship it bcoz it executes in run-time.
Basically, I need something which is cheap but reliable and the software size should be relatively small.
|
|
|
|
|
Hi !
I have an Enhanced Metafile on the clipboard, which I would like to paste
into a dialog with a CRichEditCtrl....How can I do this ???
|
|
|
|
|
Hi all,
I 'm trying to establish a RPC communication using the protocol sequence
'ncacn_http' but unable to succeed. I'm already done with 'ncacn_ip_tcp'. But since 'ncacn_ip_tcp' cannot pass through a DMZ, I want to make use of HTTP communication (ncacn_http). I want to keep the RPC Server inside a DMZ (firewall) and RPC Client in the public domain. Pls reply with an example.
Thanks in advance,
Bhanu
|
|
|
|
|
I'm having trouble finding a method to automatically close and dismount a thumb drive in Windows 2K. I must automate the process such that the window dialogs don't popup. I can get it to close cleanly, but I can't the thumb drive power light to shut off to allow a clean dismount. Has anyone run into this situation?
RH
|
|
|
|
|
How to make a little pause during the running of a program?
Pause of 0.10 seconds for example.
Thank's for advance
|
|
|
|
|
use Sleep API
Sleep(100);
|
|
|
|
|
Ok thank's
But is there a function that allow to make pause only in the function it would be written.
I mean I have to let some other functions finishing before others.
With sleep, all the application is in pause.
|
|
|
|
|
No, with the sleep, this is just the current Thread that is paused. What you want is something that will 'exit' your function to enable processing of normal messages and then 'come back' at the point you left the function (it's what I've understood by your response).
The best way is to use Timers. At a point in your program, you set a timer. And when the timer fires, it will call a function and there you can continue the process.
take a look at the MSDN doc for the SetTimer function.
Hope this helps
|
|
|
|
|
When I use a breakpoint to simulate my program, I have no problems with the result. But as I run directly the program I haven't the result I hope for. So my idea is to make a pause as my breakpoint does in simulation mode. So I try to find something that can replace my breakpoint...
|
|
|
|
|
What does this function ? What are the calculations ??
Maybe if you post the code, we can help you ?
|
|
|
|
|
jeabI don't think so but here is the code:
int NumOfBlockCopied = 0;
if (lpNumberOfBytesRead == 65536)
{
CFile FileName(m_csPCFileName,CFile::modeCreate | CFile::modeWrite);
while (lpNumberOfBytesRead == 65536)
{
typedef BOOL (__cdecl *USB_ReadFile) (PVOID,DWORD,LPDWORD,ULONG);
FileName.Write(szBuf,65536);
NumOfBlockCopied ++;
lpNumberOfBytesRead = 0;
pUSB_ReadFile = (USB_ReadFile)GetProcAddress(theApp.g_hDllXtlUsb,"USB_ReadFile");
if (!pUSB_ReadFile)
{
FreeLibrary(theApp.g_hDllXtlUsb);
return FALSE;
}
else
{
BOOL BRead = TRUE;
BRead = pUSB_ReadFile((LPVOID)szBuf,nNumberOfBytesToRead, &lpNumberOfBytesRead,Timeout);
if (nNumberOfBytesToRead == 0)
return FALSE;
}
DWORD FileSizeTransfert = FileName.GetLength();
// m_progbUSBTransfert.SetPos((64/iFileSize*1000)*100);
}
m_progbUSBTransfert.SetPos(100);
}
if (theApp.m_bCommunicationMode == FALSE)
{
typedef BOOL (__cdecl *USB_CloseDevice)(); /// Close USB Communication
USB_CloseDevice pUSB_CloseDevice;
if (theApp.g_hDllXtlUsb != NULL)
{
pUSB_CloseDevice = (USB_CloseDevice)GetProcAddress(theApp.g_hDllXtlUsb,"USB_CloseDevice");
if (!pUSB_CloseDevice)
{
FreeLibrary(theApp.g_hDllXtlUsb);
return FALSE;
}
else
{
BOOL BCloseDevice = TRUE;
BCloseDevice = pUSB_CloseDevice();
}
}
}
// PESDEMUX_ProcessFile : Row File converted to Program Stream
pStatus->SetWindowText("Converting to mpg File..."); ///////////// BREAKPOINT HERE
//Sleep(2000);
m_progbUSBTransfert.SetPos(0);
typedef LONG (__cdecl *PESDEMUX_ProcessFile)(CHAR*,CHAR*,INT);
PESDEMUX_ProcessFile pProcessFile;
CHAR chInFileName[255];
strcpy(chInFileName, m_csPCFileName); //Conversion CString to CHAR*
CHAR chOutFileName[255];
m_csPCFileName = m_csPCFileName + ".mpg";
strcpy(chOutFileName, m_csPCFileName); //Conversion CString to CHAR*
INT Type = 1;
HINSTANCE hDll = 0;
hDll = LoadLibrary("XtlPes.dll");
if (hDll != NULL)
{
pProcessFile = (PESDEMUX_ProcessFile)GetProcAddress(hDll,"PESDEMUX_ProcessFile");
if (!pProcessFile)
{
FreeLibrary(hDll);
return FALSE;
}
else
{
BOOL BResult = TRUE;
BResult = pProcessFile(chInFileName,chOutFileName,Type);
if (BResult == FALSE)
{
TRACE("Conversion Process OK\n");
}
else
TRACE("Conversion Process non OK\n");
}
}
|
|
|
|
|
How do I set a dialogs icon from a created icon recource. It’s not the main dialog I wish to set.
.....and justice for all
APe
|
|
|
|
|
I am assuming you are using MFC. Use SetIcon function to set icon of the dialog box. For e.g.:
BOOL CMyDialog::OnInitDialog()
{
HICON hIcon = AfxGetApp()->LoadIcon(IDI_MYICON);
SetIcon(hIcon, TRUE);
}
Gurmeet S. Kochar If you believe in God, it's because of the Devil
My CodeProject Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
Thanks
.....and justice for all
APe
|
|
|
|
|
Hello
I am having two arrays of a object.
I got fixed up in finding the solution for following problem.
Array 1 holds value for the following cordinates
1 2 3 4 5
6 7 8 9 10
Array 2 can be any different situation, from above say like
1 2 3
4 5 6
7 8 9
In the object stored into the array element, there is one value "Height". Now i want to assign height in following fashion. This is done to make the previously assigned height in array1 to remain intact in a order of their coming in row.
A1 -> A2
1 1
2 2
3 3
6 4
7 5
8 6
i.e. If any addition point is there in a row then leave that additional point like 4,5 in array1 and similarly if rows are more than also leave it.
NOTE
Both Array1 and Array2 are one dimensional array, but the logical position/location of values stored in it is like this. So this is to give an idea that with this type and any similar cases (where rows and points per row increases or decreases) , how the value is to be assigned.
So main aim is to assign the array element shown in above and below example based on following mentioned logical positioning of the points.
NOTE: Well number of rows and points per rows in both case is provided.
Other example can be like this:
Array 1
1 2 3 4
5 6 7 8
9 10 11 12
Array2
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
Assigning:
A1 -> A2
1 1
2 2
3 3
4 4
5 6
6 7
7 8
8 9
9 11
10 12
11 13
12 14
How to do this?
Am i clear in communicating the problem i am facing?
_________________
Leave Your Mark Wherever You Go
Leave your mark wherever you go
|
|
|
|
|
Hello in short and sweet
I am having a case like this:
Design is having Number of rows and Points per row
(This are editable)
Well user set the values for Number of rows say 4 and points per row 10 then system will make 40 objects and will store them the CObArray mentioned above.
Assigned with each object is an ObjectID say 0,1,2,....,39.
So above is the case when user mention all of the data provided and system stores them to CObArray
NOW if user changes the NUMBER OF ROWS or POINTS PER ROW or both. say 3 and 12 ,then system has to take it into consideration and has to restore the previous rowwise data back to the new one.
That is main theme and based on this only is my above query.
Sandeep
Leave your mark wherever you go
|
|
|
|
|
Any got a tip on how to create a theme for an MFC-dialog project?
.....and justice for all
APe
|
|
|
|
|
Hi, how to set form/control width and height in VC++ IDE or in code? I mean, if i want it
to be exactly 100x200pixels, how do i do that in the IDE or by code? Is there anything similar to Visual Basic?
I have a simple program that adds two numbers in array using MMX (inline assembly), the program works fine, the code as shown below,
The result on screen is :
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
which is correct,
however, if i change the line
char incamt[]={u,u,u,u,u,u,u,u};
to
char *incamt;
incamt=new char[8];
for(int j=0;j<8;j++) incamt[j]=u;
the program compiles but the result is wrong! Why is that?
Output:
9 82 117 68 17 18 19 20 17 90 125 76 25 26 27 28 25 98 -123 84 33 34 35 36
#include "stdafx.h"
#include <iostream.h>
void main()
{
const u = 5;
//an array of increment amounts to aid SIMD-style operation
char incamt[]={u, u, u, u, u, u, u, u};
//instr is an array of 24 bytes
char instr[]={65,66,67,68,69,70,71,72,73,74,75,
76,77,78,79,80,81,82,83,84,85,86,87,88};
//the following is an embedded assembly code which
//uses MMX instructions to add in parallel the
//amount u to all the bytes of the array instr
__asm
{
movq mm1,incamt //mm1 has value u in all its 8 bytes
mov cx, 3 //initialize loop count
mov esi, 0 //initialize index register
L: movq mm0, instr[esi] //mm0=next 8 bytes from instr
paddb mm0,mm1 //parallel add 8 bytes of mm0 & mm1
movq instr[esi],mm0 //move result to instr
add esi, 8 //update index register
loop L //loop back
emms //empty MMX state
} //end of assembly code
//C++ code to output the results for verification
for (int i=0;i<24;i++) cout<<int(instr[i])<<" ";
="" cout<<endl;
="" just="" to="" pause="" the="" screen
="" cin="">>i;
} //end of main
|
|
|
|
|
uus99 wrote:
how to set form/control width and height in VC++ IDE or in code
Use SetWindowPos for this purpose. Ex:
::SetWindowPos(hwnd, NULL, 0, 0, 100 <font color=green></font>, 200, <font color=green></font>, SWP_NOMOVE | SWP_NOZORDER);
Gurmeet S. Kochar If you believe in God, it's because of the Devil
My CodeProject Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
SO there is no way i can resize a control in the IDE like Visual Basic? Hmm.
|
|
|
|
|