- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 41
- Posts with Upvotes
- 40
- Upvoting Members
- 19
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
202 Posted Topics
heres my timer class with a module(on a group project for create a DLL): 'Module: Option Explicit Private Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long Private Declare Function KillTimer Lib "user32" (ByVal hWnd As … | |
heres my RayCasting code on VB2010(it can be another programming language, i will get the same bug): Private Function GetPositionMap(ByVal Position As Double) As Integer Return fix(Position / ObjectSize) End Function Private Sub DrawRays() Dim StepX As Double Dim StepY As Double Dim VertX As Double Dim VertY As Double … | |
these is the VB6 function for RayCasting: Private Sub DrawRays() Dim StepX As Double Dim StepY As Double Dim VertX As Double Dim VertY As Double Dim HorizX As Double Dim HorizY As Double Dim MapX As Long Dim MapY As Long Dim HorizDist As Double Dim VertDist As Double … | |
How use and declare CopyMemory() API function VB2010? | |
how can i convert cursor files to image? i need see the cur\ani on picturebox?(just for learning) Private Sub btnChooseImage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChooseImage.Click If (ofdChooseFile.ShowDialog = Windows.Forms.DialogResult.OK) Then If (ofdChooseFile.FilterIndex = 6) Then Dim cur As New Cursor(ofdChooseFile.FileName) PicShowImage.Image = cur 'error yes Else … | |
how can i convert these C line: (py>>6)<<6) to VB6? | |
heres my RayCasting function: Private Sub DrawRays2() Dim AY As Double Dim AX As Double Dim StepX As Double Dim StepY As Double Dim VertX As Double Dim VertY As Double Dim HorizX As Double Dim HorizY As Double Dim MapX As Long Dim MapY As Long Dim HorizDist As … | |
i'm using CreateDIBSection(): Public Function NewImage(ByVal ImageWidth As Long, ByVal ImageHeight As Long, Optional color As ColorConstants = vbBlack) As Long If (Width > 0 Or Height > 0 Or hBitmap > 0 Or PointerPixelData > 0) Then DeleteImage Width = ImageWidth Height = ImageHeight 'Criar HDC MemoryHDC = CreateCompatibleDC(0) … | |
how send parameters on CreateThread()? on a class: Option Explicit Private Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long Private Declare Function TerminateThread Lib "kernel32" (ByVal hThread As Long, ByVal … | |
i have tried several ways, but i always get an overflow error :( how can i combine the ARGB color elements? Public Function ARGB(ByVal alpha As Byte, ByVal red As Byte, ByVal green As Byte, ByVal blue As Byte) As Long Dim color As Variant color = CDec(alpha) * 256 … | |
see these 'for' loop: Public Function SetTransparentColor(color As Long) Dim X As Integer Dim Y As Integer Dim c As Long Dim h As Long Dim w As Long Dim temp As BGRAQUAD ' substitua BGRColor pelo tipo de dado correto usado em bDibBGRA h = Height - 1 w … | |
using the Circle method and knowing the start angle(playerangle-30) and end angle (playerangle+30), in degrees, how can i draw the arc? | |
heres a sample of using pointers on VB6: Option Explicit Private Const BI_RGB = 0 Private Const CBM_INIT = &H4 Private Const DIB_RGB_COLORS = 0 Private Const USE_BITMAP_ALPHA = &H1000000 Private Type BITMAPINFOHEADER biSize As Long biWidth As Long biHeight As Long biPlanes As Integer biBitCount As Integer biCompression As … | |
i build a class for create a static control(label). and i't cool. but why the SetTextColor() and SetBkColor() are ignored? case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint(inst->hwnd, &ps); // TODO: Add any drawing code here... SetBkColor(hdc, RGB(0,255,0)); SetBkMode(hdc,TRANSPARENT); SetWindowText(inst->hwnd,"hello"); EndPaint(inst->hwnd, &ps); } the inst is the class(label) pointer … | |
Re: learn directx for c++:http://www.youtube.com/watch?v=0kpSiitk4eI but if you are using Visual Studio, you can learn XNA: http://www.youtube.com/watch?v=yi167gMOi-I and you need learn Game Design Theory and Practice: http://www.amazon.com/Game-Design-Practice-Wordware-Developers/dp/1556229127 | |
i have code for write on console and change the text color and backcolor and clear screen(and much more) inside of a nice class console. these function change the text color and back color: void SetColorAndBackground(int ForgC, int BackC=0) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), ForgC|(BackC<<4) ); } but is there any way for … | |
without use DirectX, how can i get rendering\graphics speed? i created an Image class that uses DIB's... but something seems wrong for i draw in a pixel way.. too slow, maybe because i'm trying getting the line, 3D, points. maybe someone can give me more info: Friend Sub DrawImageRectanglePoints(DestinationHDC As … | |
i have 1 function that give me an array of a line points... on these array, how can i get the array size without using the UBound() and LBound()? | |
if i have X,Y(10,20) and the speed is 2, will be: X = X + 2 Y = Y + 2 ? same goes for Z or it depends on direction?(Y or X rotation) | |
i'm learning Math for 3D... for now i can draw a plane and convert 3D to 2D(the screen is 2D): Private Function ConvertPositon3DTo2D(Position As Position3D, World3DSize As Size3D) As POINTAPI Dim ConvertedPosition As POINTAPI Dim PosZZDepth As Long PosZZDepth = Position.Z + World3DSize.Distance If (PosZZDepth = 0) Then PosZZDepth = … | |
why, on windows 10, some touchpad drivers(even updated by windows) don't activate the vertical\horizontal scrool move.... i have them activated, but don't work.... when i use the finger, instead scrool, the move moves.. yes i have seen the scrool area. how can i fix the problem? | |
how can i print 3 values(without knowing their string\number size) in same column using cout? i'm using these code: cout <<"\n" << "show tokens\n"; for(unsigned int i=0;i<Tokens.size(); i++) { cout << "Token: " << Tokens[i].Token <<right<<setw(20-Tokens[i].Token.size())<< "Type: " << Tokens[i].Type <<setw(40) << fixed << "Position Line: " << i<<"\n"; } … | |
i'm creating a program using Code Blocks with GNU\GCC compiler. i'm using Windows 10 with Windows Defender. my program create a txt files(instead a text files, we can speak binary files too), but the Windows Defender can delete the file(and i have sure), for avoid these problem i must disable … | |
Re: Husoski: using scanf("%255s", opinions); accept space\tab too? | |
Re: i need speak ;) everytime that i create a topic, i recive an email... jonh_165 you can test that... now the notifications can have a delay, but they will be showed... i use hotmail. anotherthing: when you are login, maybe, you don't recive the notifications... ok, i'm sepaking by head, … | |
the question seems simple, but isn't. think that i have the functions list and it's parameters and the variables on vectors(inclued it's types.. it's a structure). now see these string(yes i have the words\operators count): function1 ( function2 ( ) , function3 ( parameter1 ) , parameter3 ) the count, … | |
i create the read(...) function for read to variables. but i need too the read()(without arguments) for press enter before continue\exit. void read() { //wait if the enter key is pressed: cin.ignore(); cin.get(); } template<typename first_t, typename... rest_t> void read(first_t &first, rest_t... rest) { std::cin >> first; read(rest...); //function is … | |
i'm trying using the GNU compiler with command lines( using the ShellExecuteEx()). when i do: string FileName1="C:\\Program Files\\mingw-w64\\x86_64-7.2.0-win32-seh-rt_v5-rev1\\mingw64\\bin\\x86_64-w64-mingw32-g++.exe"; run(FileName1,"-c \"C:\\Users\\Cambalinho\\Documents\\CB\\testfolder\\bin\\Debug\\test2.cpp\""); the object file is created. these line creates the exe: run(FileName1,"-o C:\\Users\\Cambalinho\\Documents\\CB\\testfolder\\bin\\Debug\\test2.exe C:\\Users\\Cambalinho\\Documents\\CB\\testfolder\\bin\\Debug\\test2.o"); (tested) but the exe have some dependencies... so seen the Code Blocks: x86_64-w64-mingw32-g++.exe -Wall -g -std=c++14 -c … | |
i'm using Windows 7. the battery icon is showed on toolbar. when i move the mouse the percent is showed, but no the time remain... why? | |
heres my actual code for find\search a folder: string FindDirectory(std::string FindDirectoryName[2], std::string StartDirectory="C:") { WIN32_FIND_DATA file={0}; string str=StartDirectory+ "\\*"; HANDLE search_handle = FindFirstFile(str.c_str(), &file); static bool blnFindDirectoryName=false; static string strFolderName =""; //testing if the folder is valid: if (search_handle != INVALID_HANDLE_VALUE) { do { //if the folder was founded, then … | |
how avoid memory leaks? from here: http://www.winprog.org/tutorial/bitmaps.html i learned: GetDC() - ReleaseDC() BeginPaint() - EndPaint() CreateCompatibleDC() - DeleteDC() i must get the old selected object. select it when isn't needed and then delete it. so seen these constructor and desctructor: image(const int width, const int height) { if (isimgused==true) delete … | |
i have these GNU macro: #if defined __GNUC__ #define EVENT [[gnu::weak]] #elif defined __clang__ #define EVENT [[llvm::weak]] #endif #define IS_EVENT_DEFINED(sym) (static_cast<bool>(sym)) these macro works fine. and help me test if the function(even with a prototype) was defined. my problem is can i convert [[gnu::weak]] to Visual Studio code(for be compatible)? … | |
the C++ have virtual functions, but, for me they have 1 problem: on derived class, i must prototype them, for define them on Global Scope. how can i avoid the re-prototype them on derived class? i tried 1 way: template <class Type> class TypeHasToString { // This type won't compile … | |
i know save the Image on IStream. but what isn't saved like the original: the backcolor goes to black instead stays white. i belive that the problem is the transparent color, because isn't saved on IStream. i had tryied use the ColorPalette(Image.GetPalette() and Image.SetPalette(), but the ColorPalette.Count it's zero), but … | |
i can change the windows media player skin. readers: please save the skin on a folder instead execute it, when on download. or will get an error. when i execute the windows media player show me the skin that i had selected. but why the button play is disable?(i have … | |
i did a class for the timer precision using the timeSetEvent(). of course i can have more than 7 instances from the Timer class(with 200ms or something so small). is these a limitation or what? class Timer { private: static unsigned int TimerCount; UINT_PTR timerid; UINT m_uResolution=0; unsigned int TimerID=0; … | |
i have these code for get image pixel data: typedef std::vector<BYTE> pixeldata; pixeldata GetImagePixel(HDC hdcImage) { BITMAP bmp = {0}; BITMAPINFO Info = {0}; memset( &bmp, 0, sizeof(BITMAP) ); HBITMAP hBitmap =(HBITMAP) GetCurrentObject(hdcImage, OBJ_BITMAP); GetObject(hBitmap, sizeof(BITMAP), &bmp); BITMAPINFO info { }; info.bmiHeader.biSize = sizeof(info.bmiHeader); info.bmiHeader.biWidth = bmp.bmWidth; // pay attention … | |
i'm getting problems, again, on how i get the frame delay on gif files using Image class: UINT TotalBuffer = img2.GetPropertyItemSize(PropertyTagFrameDelay); //img2 = (PropertyItem*)malloc(TotalBuffer);//my compiler gives an error img2.GetPropertyItem(PropertyTagFrameDelay,TotalBuffer,&img2); framedelay=TotalBuffer; seems that the GDIPLUS can be a litte diferent from compiler to compiler :( so how can i get the … | |
the window have a icon, on caption\title bar. that icon show us the System Menu(mouse right button). my objective is add to it the Allways on Top option. using a program, on background, i can do it. but i will have another program on process's. so is there another way … | |
using: char username[255+1]; DWORD username_len = 255+1; GetUserName(username, &username_len); i get the actual user name. but how can i get the program folder name for execute a program? the '%ProgramFiles(x86)%' on folder name string is ignored :( | |
i never used VBScript. how can i use win32 functions? | |
can i add 1 item on standard System Menu? (my big objective is just add 1 item for put the window allways on top) | |
i have my own region class: class region { private: BYTE* Get24BitPixels(HBITMAP pBitmap, WORD *pwWidth, WORD *pwHeight) { // a bitmap object just to get bitmap width and height BITMAP bmpBmp; // pointer to original bitmap info LPBITMAPINFO pbmiInfo; // bitmap info will hold the new 24bit bitmap info BITMAPINFO … | |
i'm trying getting the richedit caret positions. seems that i can't use the caret functions. LONG firstCharIndex(HWND hwnd) { POINT pt; pt.x=0; pt.y=0; LONG n = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM)&pt); return LOWORD(n); } COORD GetCaretPos( ) { COORD pos; //getting the line from caret position: pos.Y=(LONG) SendMessage(consoleedit, EM_LINEFROMCHAR,(WPARAM)-1,0); CHARRANGE cr; … | |
how can i resize a window console buffer? i know that i can use the SetConsoleScreenBufferSize(), but i'm getting problems convert from pixels to characters, because the vertical scrollbar is showed and the size isn't changed correctly, because it's more big than the buffer size: CONSOLE_SCREEN_BUFFER_INFOEX consolesize; consolesize.cbSize=sizeof(consolesize); GetConsoleScreenBufferInfoEx(hConsole,&consolesize); COORD … | |
i have these code for save a structure data to a file and then read it: struct user { string name; image foto; string adress; int age; }; user usrName={"joaquim",image("C:\\Nova pasta\\acrobat.bmp"), "viseu",32}; user usrName2; FILE* f = fopen("C:\\Nova pasta\\username1.dat", "w+b"); if(f==NULL) DebugText("error"); fwrite(&usrName, sizeof( user), 1, f); fseek(f, 0, SEEK_SET); … | |
i need just an intro about Matrix. what is Matrix and what i can do? i understand that i can rotate, scale, mirror and more. but can i swap pixels?(convert red to green) i don't know so much about Matrix intro :( | |
see my MemoryDc and BitmapDC class's: class MemoryDC { private: HDC memoryDC; public: MemoryDC () { HDC hdc=GetDC(GetDesktopWindow()); memoryDC=CreateCompatibleDC(hdc); ReleaseDC(GetDesktopWindow(),hdc); } operator HDC() const { return memoryDC; } ~MemoryDC () { DeleteDC(memoryDC); } }; class BitmapDC { private: MemoryDC hdcbitmap; HGDIOBJ bitmapold; HBITMAP bitmapcurrent; int intwidth; int intheight; void init(int … | |
can i print a window without printer dialog? | |
i'm converting the VB6 DIB code to C\C++ from: http://www.tannerhelland.com/42/vb-graphics-programming-3/ **V – Using DIB Sections** but doing by steps... how can i convert: ReDim ImageData(0 To 2, 0 To bm.bmWidth - 1, 0 To bm.bmHeight - 1) to C\C++? for then use it on GetDIBits() function |
The End.