Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

vilmer

@vilmer
About
Posts
28
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • DateTime Format on remote machine
    V vilmer

    The remote machine hosts a scada system and I can manage some APIs to exchange data with it. The remote machine comes as is, so I can't install any other component on it. I just have this library to communicate with it and the function defined in my library returns me a string

    Visual Basic help tutorial question

  • DateTime Format on remote machine
    V vilmer

    Sorry, maybe I didn't tell you that the date comes as a string. I can't wonder about its format. If the machine had english date format, 01/03/06 means 2006/Jan/03.

    Visual Basic help tutorial question

  • DateTime Format on remote machine
    V vilmer

    Hi everyone, I am trying to develop an app which should read date info from a remote machine (which has MS win on board). My problem is: I don't know the CurrentCulture of the remote machine and therefore I don't know which is the DateTime format of the dates I retrieve. If I get some special dates, for example 02/01/06, I wouldn't know which one represents the day, month or year. Is there any way to retrieve the culture or just the datetime format of the remote machine? N.B. just keep in mind that I only know the IP address of the remote machine and I'm not allowed to deploy any component on it

    Visual Basic help tutorial question

  • Error with Jet 4.0
    V vilmer

    I use COM inside .NET because I am just testing ADO with dBase IV files. This sample code is just a test application. The main application where the performance of ADO is critical is written in VBA, so I have to use standard COM objects. During my tests, I have discovered an abnormal behaviour of my test application: I have several standard machines (WinXP SP2, MDAC 2.8, etc...) and in one of them it works properly. It's quite strange because in that one, the driver doesn't accept file names longer than 8 chars (defined as DOS 8.3 standard names). I've checked all drivers version and it seems they are the same in every machine. Does anyone know which package (or settings) could make this possible?

    Database help learning

  • Error with Jet 4.0
    V vilmer

    I found nothing about my problem in that page. I'll try to be more explicit. Here's a sample of my test code: Private Shared WithEvents mtmr_Timer As Timers.Timer Private Shared mstrPath As String Private Shared mstrFile As String Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click If mtmr_Timer Is Nothing Then mtmr_Timer = New Timers.Timer End If AddHandler mtmr_Timer.Elapsed, AddressOf CheckVariable mtmr_Timer.Interval = 500 mtmr_Timer.Start() End Sub Private Shared Sub CheckVariable(ByVal source As Object, ByVal e As ElapsedEventArgs) Dim objConn As Connection Dim objRS As Recordset Try objConn = New Connection objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & mstrPath & ";" & _ "Extended Properties=""DBASE IV;"";" objConn.Open() objRS = New Recordset objRS = objConn.Execute("SELECT top 20 * FROM " & mstrFile & " ORDER BY 1") If Not (objRS.EOF And objRS.BOF) Then objRS.MoveFirst() While Not objRS.EOF objRS.MoveNext() End While End If Catch ex As Exception mtmr_Timer.Stop() MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OKOnly) Finally If Not (objRS Is Nothing) Then objRS.Close() objRS = Nothing End If If Not (objConn Is Nothing) Then If objConn.State = ConnectionState.Open Then objConn.Close() End If objConn.Dispose() End If GC.Collect() End Try End Sub

    Database help learning

  • Error with Jet 4.0
    V vilmer

    Hi everyone, I've a quest for you. I have to read data from a DBF file using Microsoft Jet 4.0. Connection and data reading are OK up to about 1045 times. From that moment, the driver send always an exception with the message: "System resource exceeded" I've tried to switch to a ODBC driver (through DSN) but the problem still remains. My machine has a WinXP SP2 installed, with SQLServer 2000 SP4. If someone has a tip... Thanks, Vilmer

    Database help learning

  • Creating COM Objects Failure
    V vilmer

    Hi everyone, I need to create a COM Object from a ASP.NET web service, but the server returns me an exception. My code is: Dim objZenOnApplication as new zenOn.Application objZenOnApplication = Server.createobject("zenOn.Application") The exception details are: System.UnauthorizedAccessException: Access denied Then it explains that ASP.NET has no rights to access the requested resource and I should change my identity or my rights in IIS configuration or to give ASP.NET the rights to write a file. Still I don't understand why I should give ASP.NET the rights to write a file, since my COM object writes no file. The exception is cathced at the second line, when I try to create my object. I also tried to use the "new" function, but it returns the same exception. Any idea??? Vilmer 8=X

    ASP.NET csharp asp-net com sysadmin windows-admin

  • Memory Overwrite
    V vilmer

    Code is manuf[i] = strdup("Hello"); the function provides to create a location of memory where it copies the string and writes the address of that location on the pointer manuf[i]

    C / C++ / MFC question data-structures performance help

  • Memory Overwrite
    V vilmer

    Hi, I have noticed a strange behaviour in my app. I have 4 staic items: static char* manuf[512]; static int link_man[512]; static char* comp[128]; static CDatasheet DS; where CDatasheet is a class derived from CObject. Filling in the manuf array, when I reach the 264th item, the app starts overwriting the memory space allocated for the DS object. So any assignment operation to that object produces an error. Any suggestion? Another question: I tried to remove the DS object (commented out), but the compiler still build the app. I parsed all my files, but there are no other declaration for that object. What can it be happened? Thanks Dwarfpower

    C / C++ / MFC question data-structures performance help

  • File stream as function parameter
    V vilmer

    Ok, you're right, I'm a dope! :zzz: It works. But I discovered that the real problem is in variables declaration. I'm using fscanf instead of fgets because I need to read a text and analyze each word: FILE* source; char* word = new char[512]; fscanf (source,"%s",word) So, fscanf needs a char* initialised this way, otherwise it won't work. But the pointer initialisation crashes the program. Any suggestion? Thanks

    C / C++ / MFC debugging question announcement

  • File stream as function parameter
    V vilmer

    Hi, I need to parse text files to search some keywords. I split the search process into many different functions (because they search for different contents). So I thought I could open the file just once and then pass the file stream as a function parameter. In debug mode, the app runs, but in release mode it crashes. Can someone explain me why? Here is a sample of the code: void F1 (FILE* source) { ... } void F2 (FILE* source) { ... } void main() { FILE* source; source = fopen("myfile.txt","r"); F1(source); F2(source); }

    C / C++ / MFC debugging question announcement

  • COS Objects
    V vilmer

    Hi everyone, does anyone know whay the name COS means? I'm talking about the objects of the PDF file structure... Thanks

    The Lounge question

  • Open files
    V vilmer

    Hi everybody. I need to open some files from my app. So I used do parse the register in order to obtain the default program and run it. For example, to open a pdf file I parsed the HKEY_CLASSES_ROOT for the ".pdf" key and got AcroExch.Document as value. Then I parsed again HKEY_CLASSES_ROOT for the "AcroExch.Document\shell\comman\open\" key and got the whole path of Acrobat Reader. Finally I opened the file using spawnl command. With Acrobat it's almost all OK, but I neede to open html files too. And Internet Explorer doesn't work as Acrobat does, besides I got the right value of Ecplorer's path. Any suggestion? Is there any other way to open a file using its default program? Thanks,

    C / C++ / MFC html linux tutorial question

  • Removing combo box from filedialog
    V vilmer

    Hi, I need to remove the lower combo box in a File Dialog (I mean the one which let you choose the file type). I've tried with HideControl(cmb1) where cmb1 is the ID of that combo box, but I can't hide it (the command works with the other two Combo boxes). Notice: I'm using VS 2003.NET, the File dialog is a bit different from the old one. Thanks Vilmer

    C / C++ / MFC csharp visual-studio

  • linking static variables
    V vilmer

    I've just declared the veriables as static, but in MyDialog class (where MyDialog is the main dialog class of my app)

    C / C++ / MFC question help

  • linking static variables
    V vilmer

    Hi, I'm trying to use threads in my app and I should use static variables shared between all threads. Linking the app generates a link error: unresolved symbol static etc... How can I avoid it? Thanks Vilmer

    C / C++ / MFC question help

  • To get current Login User name from within a service.
    V vilmer

    Hi, you can try to access the windows register at \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer and catch the value of Logon User Name key. To do this use: HKEY masterKey = HKEY_CURRENT_USER; CString SubKey = "\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"; HKEY hKey; if (RegOpenKey(masterKey,SubKey,&hKey) == ERROR_SUCCESS) char ValueName[1024]=""; DWORD dwValueNameSize=sizeof(ValueName); DWORD dwType=REG_NONE; BYTE Data[1024]=""; DWORD dwDataSize=sizeof(Data); while (strcmpi(ValueName,"Logon User Name") != 0) { LONG Result=RegEnumValue(hKey, dwIndex, ValueName, &dwValueNameSize, 0, &dwType, Data, &dwDataSize); dwIndex++; } --- You will get the user logon on ValueName string For furhter details see also http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regenumvalue.asp

    C / C++ / MFC c++ question

  • Update Listcontrol
    V vilmer

    I'll show you an example of how my code works: CListCtrl myLC; int Num; (as members of CMyClass) void CMyClass::OnButtonStart() { Num = 0; char* ptrItem; while (Num < 100) { itoa(Num,ptrItem,10); myLC.InsertItem(Num,ptrItem); Num++; } } If I use AfxBeginThread(MyThread,this) - where MyThread provides only the InsertItem statement - inside the while statement and then refer to a CMyClass instance, that instance show a value of Num which is already 100, beacause the while statement doesn't wait for the thread to finish its execution. :eek: Aaarrgggghhhh

    C / C++ / MFC question announcement

  • Update Listcontrol
    V vilmer

    Yeah, you hit the problem. But the items of the listcontrol are related to some data which change in the while loop. If I use threads, the data taken from any thread won't be correct, because the while statement continue its run, not taking care of the threads execution. My question is: is there any way to create a (or more) thread which can use dynamic data which depend on something outside the thread? I know that threads can refer to a pointer to parent, and they can use its member variables, but there's no way for me to make that data useful, because they change always.

    C / C++ / MFC question announcement

  • Update Listcontrol
    V vilmer

    Hi everyone, my app should update a listcontrol inside a while statement, but the data are shown only at the end of the whole function, when the app gets the idle state. Furthermore, all the buttons can't be pressed until the end of the function. Can somenone explain me the way to work with it? Thanks Vilmer

    C / C++ / MFC question announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups